3

i am using ab command to hit the http request to my local host .

now on server side i want to check how many request currently getting handled by my nginx server.

like in case of DB we can check the list of db-connection made by any application....

same way how to check .....

mayur
  • 31
  • 2

1 Answers1

2

Add this to you localhost config (default):

server {
  server_name  localhost;
      [---snip---]
  location /nginx_status {
    stub_status on;
    access_log   off;
    allow 127.0.0.1;
    deny all;
  }
      [---snip---]
}

Then read (from localhost only) with:

$ wget -O - -q http://localhost/nginx_status

gives (for example):

Active connections: 2 
server accepts handled requests
 31432 31432 631255 
Reading: 0 Writing: 2 Waiting: 0 
shellholic
  • 1,287
  • 9
  • 11