Using Monit to deal with Akara performance issues

On Ubuntu you can do:

aptitude install monit

Sample monitoring section from /etc/monit/monitrc file:

  check process akara with pidfile /home/USERNAME/.local/lib/akara/logs/akara.pid
    start program = "/home/USERNAME/.local/bin/akara start" with timeout
60 seconds
    stop program  = "/home/USERNAME/.local/bin/akara stop"
    if cpu > 80% for 5 cycles then restart
    if totalmem > 200.0 MB for 5 cycles then restart
    if children > 50 then restart
    if loadavg(5min) greater than 10 for 8 cycles then stop
    if failed host localhost port 8880 protocol http
       and request "/"
       then restart
    if 3 restarts within 5 cycles then timeout

sudo monit -t to check for any syntax errors in the config

You also have to enable it in /etc/default/monit and then start it as root via "/etc/init.d/monit start". You can configure logging and email alerting as you require. No alert actions in configuration above, but easy enough to enable.

Akara/Performance/Monit (last edited 2010-03-03 03:56:55 by UcheOgbuji)