开发者

Rubygem God: Time limit configuration for process

I am using resque, resque-scheduler gems in my 开发者_高级运维rails app. To monitor the working of resque workers, I am using God tool. I want to add such a god configuration, which will monitor the time of job running in the resque worker. If process execution exceeds the time limit, then it should restart the worker.

I read post at http://god.rubyforge.org/. However, couldn't peek the right code base for my requirement.

Any information will be highly appreciated.

Thanks.


You could do something where your job creates a pid file, which you can use the FileMtime condition in god to monitor. When the job is finished, it recreates the pid file, if the file is older than x, restart the process with god.

source: https://github.com/mojombo/god/blob/856d321fb135a0b453046e99c266231681bd5ffe/lib/god/conditions/file_mtime.rb

Edit: Added github source


i'm having the same problem:

the main problem is that the resque god recipe doesn't monit the child (forked) process, so you can't have control over the memory or the time they spent.

Here is a solution for observe the child process:

https://github.com/mojombo/god/issues/90 https://github.com/jbgo/god/commit/918bc278e4ca5b8133fe34db06c30ccb93dcb7f0

you can use your own gem forked from the origin to add this files, i preferred to require the new files from the god recipes...

For the time problem you can develop a new condition as the given for it (i'm doing it an will post it here).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜