[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[monit-dev] Toning down sleeps in wait_start/wait_stop
From: |
Michael Renner |
Subject: |
[monit-dev] Toning down sleeps in wait_start/wait_stop |
Date: |
Wed, 8 Jun 2011 14:12:19 +0200 |
Hi Monit Team,
while playing around with monit 5.1.1 and large amounts of services (~500) I
noticed that monit was quite slow when starting these services because it would
always sleep for a second after starting a service. Same goes for stopping.
The code path apparently changed a bit in 5.2.5 (or the timings were a bit
different, causing the loop to succeed on first try) since the behavior wasn't
directly noticeable, but the sleep is still there. I'd suggest to tone down the
delay to something more useful like 5 ms (or even less), this ought to be more
than enough time on current hardware for a process to get set up. I've attached
a patch which does this.
Pulling in the complete process list to see if a service has been
started/stopped can also be quite wasteful, especially with large process
lists. Using the PID-files with sanity checks (process start time, etc.) should
be enough for most cases and the full process list sweep can still be used as a
fallthrough. But that's more of a todo item, it doesn't cause problems in our
environment ;).
best,
Michael
nanosleep.patch
Description: Binary data
- [monit-dev] Toning down sleeps in wait_start/wait_stop,
Michael Renner <=