Make monit wait longer before thinking something is dead

monit

I'm trying to start a program (Resque) but it takes a bit of time before a pidfile is written. Thus, I think that Monit thinks the program hasn't started and starts one or two more programs before the before the pidfile of the first one is written.

How do I delay the time Monit checks again, just for this process? Or should I solve this in another way?

Best Answer

How do I delay the time Monit checks again, just for this process?


What you are trying to achieve could be done via "SERVICE POLL TIME" feature of monit

Monit documentation says

Services are checked in regular intervals given by the

set daemon n

statement. Checks are performed in the same order as they are written in the .monitrc file, except if dependencies are setup between services, in which case the services hierarchy may alternate the order of the checks.

One of the method to customize service poll is

  1. custom interval based on poll cycle length multiple

EVERY [number] CYCLES

Example:

check process resque with pidfile /your/app/root/tmp/pid/resque.pid
   every 2 cycles

Or should I solve this in another way?


I also did initial attempt to monitor resque jobs with monit because monit is a very lightweight daemon but eventually settled with GOD. I know , I know GOD is more resource hungry in comparison to monit but in case of resque we found it to be a good match.