[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: monitoring apache with multiple processes?
From: |
Daniel Maher |
Subject: |
Re: monitoring apache with multiple processes? |
Date: |
Thu, 12 Aug 2010 10:13:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9pre) Gecko/20100217 Lightning/1.0pre Shredder/3.0.3pre |
On 08/11/2010 10:50 PM, Josh Sharpe wrote:
I'm not sure how to properly set up monit to watch multiple apache
proceses. I've looked at the examples and they all seem to point to a
single PID file...
check process apache
with pidfile"/usr/local/apache/logs/httpd.pid"
It's here on my distro:
$ cat /var/run/apache2.pid
32281
But Apache has more than just one process:
$ ps aux|grep apache
www-data 6843 0.0 1.1 319016 2812 ? Sl 15:46 0:00
/usr/sbin/apache2 -k start
root 32281 0.0 0.0 97316 132 ? Ss Aug10 0:04
/usr/sbin/apache2 -k start
www-data 32282 0.0 0.0 96544 4 ? S Aug10 0:00
/usr/sbin/apache2 -k start
www-data 32298 0.0 1.0 385112 2612 ? Sl Aug10 0:01
/usr/sbin/apache2 -k start
...and none of those other processes have their own PID. Is it sufficient that
monit is only watching one of them? What happens if on of the other ones
starts chewing up CPU/memory?
The process that's running as user "root" (with corresponding pid in the
pidfile) is the "parent" (or "master") process for the daemon. The
others are "children" (or "workers"), and since they come and go fairly
often under normal usage, monitoring them is not a useful exercise.
The behaviour of the child processes is governed by the master
configuration. See these docs for more information :
http://httpd.apache.org/docs/2.2/mod/worker.html
--
Daniel Maher <dma PLUS monit AT witbe DOT net>
"The Internet is completely over." -- Prince