GIT – Nginx has a status module that provides statistics on connections and requests. This shell script reads and reformats those stats and adds a few useful bits of information.
Compared to Apache’s ‘server-status’ module, Nginx’s status reporting is rather feature-limited. Moreover it’s a bit cryptic.
You can read about ‘nginx_status’ here: http://wiki.nginx.org/HttpStubStatusModule.
This script reformats the numbers from nginx_status into a more readible display and adds a few things:
- Nginx uptime;
- Requests/connection (which should give an idea of how effective your keepalive is);
- Requests/second (an overall measure of the busy-ness of your server).
Here’s the script: http://gocit.vn/files/nginx_status.sh.txt
- First you must get the nginx_status module working. See the Nginx wiki link above;
- Get the script;
- Open it in an editor and adjust the two settings at top;
- Make it executable and run it.
[email protected]:~$ ./nginx_status.sh Nginx up 40 minutes Active connections: 4 Reading: 0 Writing: 1 Waiting: 3 Connections Accepted: 249 Connections Handled: 249 Total Requests: 419 Requests/Connection: 1.7 Requests/Second: 0.2