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