[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [monit] Howto monitor multiple instances zope ?
From: |
Martin Pala |
Subject: |
Re: [monit] Howto monitor multiple instances zope ? |
Date: |
Mon, 04 Feb 2008 23:28:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071119 Iceape/1.1.7 (Debian-1.1.7-1) |
Monit starts the instances sequentially ... if the services go up too
fast, you can modify the startup script to control the parallelism.
Simple way could be for example to touch some flag file in the beginning
and remove it at the end of the start script. The script can sleep
till the number of starting instances will drop bellow the requested level.
Dummy script (not tested - may need fixes):
--8<--
#!/bin/bash
# parallelism
BARRIER=2
# where to store the startup flags
BARRIER_DIR="var/zope/parallel/"
# check that the directory exists otherwise create it
test -d $BARRIER || mkdir -p $BARRIER
# wait for number of starting instances to drop bellow limit
while [ `ls /var/zope/parallel/` -lt $BARRIER ]
do
sleep 1;
done
# we are in critical section now - set flag
touch /var/zope/parallel/$$
# do zope startup
<start zope>
# remove the flag which will allow to start the waiting instances
rm -f touch /var/zope/parallel/$$
--8<--
Note however that this is just simple example - it may have problems
such as race condition when creating the flag, or if the script will be
interrupted and will left the ghost flag file (didn't had chance to
cleanup), then if the ghost/orphaned flags count will be above the
limit, it will block the instances from startup, so as you can see, the
method needs tunning ;)
Btw. the startup throttling is interesting idea - i'll add it to the
wishlist.
Thanks,
Martin
kat wrote:
Hi,
First sorry for my english.
I try to configure monit to monitor multiple instances zope on the same
server.
My problem is that monit start all instances zope (and other monitored
services) at the same time.
What is the best way to avoid that behaviour ?
When monit start 2 or more instance zope at the same time the server is
a little overloaded.
So when you have 10 instances zope ...
Thanks
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general