Anyone have a good monit or god script for moniter apache/passenger?

246 views
Skip to first unread message

Will

unread,
Dec 15, 2008, 10:59:48 PM12/15/08
to Phusion Passenger Discussions
Hi,

I am looking for a monit or god config for monitoring apache with
passenger installed.

Thanks

Will

Lee Hambley

unread,
Dec 16, 2008, 5:21:31 AM12/16/08
to phusion-...@googlegroups.com
Will,
 
 They alledge that you don't need it - though I'm working on something that gets the individual pids.
 
Care to share notes?
 
-- Lee
2008/12/16 Will <will....@gmail.com>

James Elwood

unread,
Dec 16, 2008, 8:14:48 AM12/16/08
to Phusion Passenger Discussions
I've been using monit to manage Apache which seems to be more than
enough to keep an eye on the whole stack.

On Dec 16, 5:21 am, "Lee Hambley" <lee.hamb...@gmail.com> wrote:
> Will,
>
>  They alledge that you don't need it - though I'm working on something that
> gets the individual pids.
>
> Care to share notes?
>
> -- Lee
> 2008/12/16 Will <will.va...@gmail.com>

Lee Hambley

unread,
Dec 16, 2008, 9:07:33 AM12/16/08
to phusion-...@googlegroups.com
I have been using GOD, but it doesn't accurately report the memory usage of Apache, it says its always ~1.5 meg, which i think is a lie. i'm currently altering it to check the passenger fifo file, and read the individual process pids, and kill them if they start misbehaving :)

My mileage hasn't been great though- i may yet refocus my efforts on figuring out how GOD checks memory usage... Real/Vs./Virtual etc

- Lee

2008/12/16 James Elwood <DrM...@gmail.com>

Peer Allan

unread,
Dec 16, 2008, 10:30:11 AM12/16/08
to phusion-...@googlegroups.com
its not GOD or monit but is a nice article using munin

http://www.dcmanges.com/blog/rails-application-visualization-with-munin

Peer

MarcoJ

unread,
Dec 18, 2008, 5:36:10 AM12/18/08
to Phusion Passenger Discussions
I am using the following Monit script. Besides the normal checks for
cpu load and memory usage I have created a web page called alive and
all it does it do a very simpel select onto the database. Every 30
seconds I check if that link is still OK. If for some reason that link
is not working for two times in a row I restart Apache and I receive
an alert message. It is a very basic check, but so far I has served
its purpose. Our hardware loadbalancer is checking the same page.

On my database sever I use Monit as well to check the stats of MySQL.

Hope this helps,


Marco

PS One thing that I still need to add to my Monit script is to take
automatic action if one of my Ruby process go to 100%, that happens
maybe once every two weeks. At this moment I still kill that process
manually.

##############################################################################
## Monit control file
###############################################################################

set daemon 30
set mailserver localhost
set logfile /var/log/monit.log

set alert <your e-mail address>

set httpd port 2812
allow localhost
allow <your ip address>
allow <your user-name>:<your password>

check system localhost
if loadavg (1min) > 8 then alert
if loadavg (5min) > 4 then alert
if memory usage > 75% then alert
if cpu usage (user) > 70% for 8 cycles then alert
if cpu usage (system) > 30% for 8 cycles then alert
if cpu usage (wait) > 20% for 8 cycles then alert

check process apache with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 200.0 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 20 for 8 cycles then alert
if failed url
http://localhost/alive
and content == 'Site is alive!'
for 2 cycles
then restart
group server

rogerdpack

unread,
Dec 18, 2008, 5:28:48 PM12/18/08
to Phusion Passenger Discussions
This is the one feature I feel lacks still in passenger.

Another request feature would be:
currently passenger can "fair queue" so that each instance is handling
1 request at a time [at most]. With rails 2.2 it would be nice for it
to be able to handle up to the DB pool size per request.
Thanks!

alfredarr...@gmail.com

unread,
Sep 5, 2013, 3:08:18 AM9/5/13
to phusion-...@googlegroups.com
pls put script for passenger monit
Reply all
Reply to author
Forward
0 new messages