monit-general
[Top][All Lists]
Advanced

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

Optimize monit and monitrc for nginx with low latency and high throughpu


From: David Montgomery
Subject: Optimize monit and monitrc for nginx with low latency and high throughput server
Date: Mon, 5 Mar 2012 18:35:54 +0800

Hi,

The below is a default script for monit for monitoring nginx but I do
not know how to optimize for my partitical situation.

Here is the scenario.

    1) 4 cores
    2) Running nginx with fastcgi using spawn-fcgi of a web.py app
    3) I am optimizing for potentially 8K qps where I have 120 ms for
a response or else punished
    4) Once a receive a post request only network calls is to redis.
There is no reading from disk etc.  My response is a protocol buffer.
    5) I have 8 worker proccess, 2 x number of cores
    6) 20000 worker connections
    7) keepalive_timeout 20
    8) 8 gigs of Ram
    9) 146 GB Harddrive

Given the above, how would woud I modify the monit config for nginx to
optimize monit monitoring?

    check process nginx
      with pidfile "/var/run/nginx.pid"
      start program = "/etc/init.d/nginx start"
      stop program = "/etc/init.d/nginx stop"
      if failed host 127.0.0.1 port 80 protocol HTTP then restart #set
your server IP that runs nginx
      if 5 restarts with 5 cycles then timeout
      if cpu is greater than 80% for 2 cycles then alert
      if cpu is greater than 80% for 5 cycles then restart
      if totalmem is greater than 50.0 MB for 5 cycles then restart
      if children is greater than 10 then restart



reply via email to

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