views:

162

answers:

3

I've got a Perl based FastCGI app that rarely goes down. However, when it does go down, the restart is not automatic. Restarting Apache manually always does the trick but that does address improving the uptime of the app.

I'm thinking of using a cron job in conjunction with a script that uses WWW::Mechanize to periodically check on the app and restart it as required, as suggested by the folks at Perl Monks :

Keep FastCGI Processes Up and Running

Before I do that, I'm want to know if anyone knows of better ways to monitor a FastCGI process and restarting it automatically when it dies, or is the method suggested above the optimal one?

Thanks.

+2  A: 

How about not having the process supervised by Apache but using an mechanism similar to the way init(8) starts getty processes? I have found daemon to be quite useful.

hillu
+3  A: 

Monit is a nice monitoring daemon that can do automatic restarts and/or notification.

daotoad
I ended up using Monit 5.0.3. Works great except one needs Google Apps paid edition for e-mail relaying to work. ;-)
GeneQ
A: 

Most of the web servers offer already offer this as a configuration option.

Jay