monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: slow to take action


From: Jan-Henrik Haukeland
Subject: Re: slow to take action
Date: Sat, 18 Jun 2011 16:43:30 +0200

On Jun 18, 2011, at 11:33 AM, Nick Upson wrote:


> Sorry I wasn't clear, the reason that restarting a local process takes a long 
> time is that monit is stepping through all the remote host checks, the status 
> says that the operation is pending, so it has received the instruction, 
> rather than just recording the request and doing it later, could monit take 
> the action immediately and then return to checking the remote hosts.

Not in the current version. Actions are scheduled and performed at the start of 
the next check cycle (though see below). I think the code can be changed to 
perform the action directly instead of scheduling, which we did in earlier 
versions. Though there probably are other considerations for this design - I'll 
have to discuss this with Martin when he comes back from vacation.

> the check is
> 
>  if failed icmp type echo count 3 with timeout 5 seconds for 3 cycles then
> 
> so I suppose it's taking 3 x 5 = 15 seconds to decide that it's failed and 
> move on to the next one

Yes and no. It may fail directly if the host is unreachable or the network is 
down. It may only take 15 seconds if the host does not answer on a ping reply. 
On the first response from the host the test will exit with success. So this is 
one test you can tweak, for instance setting timeout to 1 seconds considering 
that under normal conditions a ping (UDP) reply will only take milliseconds.

> when monit is on a 2 min cycle is that start the cycle 2 mins after finishing 
> the last one or run at 2 min intervals with the risk of overlapping with the 
> previous cycle

The first one. As I said before; Monit run tests serialized (single-threaded) 
and there is no overlap. One other thing to note; if there are scheduled 
actions from the last test cycle, Monit does not go to sleep, but go directly 
to performing the actions (i.e. stop, start, restart..) and then directly to 
start running the tests again without sleeping. The 2 minutes sleep in your 
configuration is only done by Monit if there are no problems and all tests ran 
without problems.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]