monit-general
[Top][All Lists]
Advanced

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

Re: no PID with fastcgi, can I monitor it?


From: Martin Pala
Subject: Re: no PID with fastcgi, can I monitor it?
Date: Wed, 15 Aug 2007 22:29:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 Iceape/1.1.4 (Debian-1.1.4-1)

Monit looks for process PID given in the pidfile. The totalmem statement checks the memory of the monitored process/PID itself plus all of its childrens based on the process table => if your fastcgi servers are childrens of apache, they will take part in the totalmem result and the configuration which you attached should work (regardless of process name). The service name in the monitrc is just descriptor used in monit and don't need to match the process' name.

Martin


Micah Anderson wrote:
I want to monitor the memory usage of a fastcgi process due to a memory
leak that will eat the server alive if its not restarted. Ideally fixing
that memory leak would be the clear solution, but that will take time
and
while that happens I need to have the service running.

The problem is that fastcgi processes are started via an apache config
and they do not have a PID file. It seems like the only way to configure
monit to watch the memory of a process and restart it is if the process
has a PID file (is this correct?).

I've read the FAQ answer #3 about what to do if a process doesn't have a
PID file, but this wont work because the way the fastcgi process works.
When /etc/init.d/apache start is run the regular apache processes are
started, and then a fascgi process is started because of the following
in
my apache config:

FastCgiServer /home/sympa/bin/wwsympa.fcgi -processes 2

I can use the PID file for apache, but then it seems to me that monit
will be monitoring the apache processes, not the fastcgi process that is
spawned. It seemed logical to create a wrapper for the fastcgi process,
however there is not a mechanism to issue a 'stop' or 'restart' to the
process. It is just torn down when apache stops.

If I do something like:

check process wwsympa.fcgi with pidfile /var/run/apache2.pid
  start program = "/etc/init.d/apache2 start"
  stop program  = "/etc/init.d/apache2 stop"
  if totalmem > 1500 MB for 3 cycles then restart

will the fact that I said "check process wwsympa.fcgi" mean that monit
will actually look for those process names in the process table and
monitor them?

Thanks,
micah



--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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