• Home
  • About

VPS managed

Just another WordPress.com weblog

Feeds:
Posts
Comments
« VMware cheap but full managed VPS
Dedicated Windows Server »

Quick Nginx Status Script

07/27/2009 by vfvalent

Nginx came with this HTTP stub status module that you can get the current server status in a HTML page. However it’s not pretty comparing to Lighttpd’s and Apache’s. Moreover, the information it provides is a bit cryptic.

For example, when you browse to the stub status page (please refer to the wiki document linked earlier on how to set it up), all you get is 4 lines of text:

$ curl http://myserver/nginx_status
Active connections: 183
server accepts handled requests
 914384 914384 2725561
Reading: 3 Writing: 2 Waiting: 178

Not very meaningful. Instead, I wrote a small Python script (download here: nginxstats.py (2.3kb)) that does something like this:

$ ./nginxstats.py http://myserver/nginx_status
Conn     Conn/s     Request/s  Read  Write Wait
-------- ---------- ---------- ----- ----- -----
     157       9.57      31.07     0     2   155
     140      10.20      36.13     0     1   139
     147       9.33      33.60     0     4   143
     189      12.60      40.07     1     4   184
     164      13.07      41.53     5     2   157

Basically it fetches the data from the stub status page every 30 seconds (configurable in the script) and then do some calculation to find out how many connections have been established within the time frame, and what’s the average connections/second and requests/second. Similar to tools like vmstat, it basically runs continuously (until interrupted).

consigli Search engine optimization

LiveScience Technology

Advertisement

Like this:

Like
Be the first to like this post.

Posted in web hosting | Tagged nginx, vps | Leave a Comment

  • Pages

    • About
  • Archives

    • August 2009
    • July 2009
    • June 2009
    • April 2009
    • March 2009
    • February 2009
  • Tags

    1 gb ram acer acer aspire one apache httpd aspire one bandwidth cheap dedicated server cheap shared cheap vps cheap web server cheap xen vps dedicated hosting dedicated server dedicated server hosting dedicated servers dedicated windows economy dedicated server game server game server hosting hosting Intel Atom N270 linux linux virtual private server nginx red hat enterprise linux seven shared hosting shared web hosting unmanaged server virtual dedicated server virtualization virtual private server virtual server virtual server hosting vps vps hosting vps managed vps server web hosting windows windows 7 windows 7 rc windows server xen xen vps
  • Blog Stats

    • 477 hits
  • Post più letti

    • None

Blog at WordPress.com.

Theme: MistyLook by Sadish.


Follow

Get every new post delivered to your Inbox.

Powered by WordPress.com