Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

commerce web site running, on multiple ec2 instances. The web content is served using nginx and its a ruby on rails application. I am using a load balancer which routes the traffic to the multiple ec2 instances. Is there any way to figure out using nginx how many users it serving and how many concurrent users are present in a particular ec2 instance. SO that I can match the number os concurrent users served by nginx and the amount of CPU and memory and processes running, to generate report and do a profiling.Kindly help me out!

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The nginx StubStatus module can help you out.

If you add the following server-block under the http-context you will get a http-interface that will give you some simple statistics.

server {
  listen 127.0.0.1:8200;
  location /server-status {
    access_log off;
    allow 127.0.0.1;
    deny all;
    stub_status on;
  }
}

A request to the interface will give you the following data:

$ GET http://127.0.0.1:8200/server-status
Active connections: 20 
server accepts handled requests
 61940 61940 1718912
Reading: 1 Writing: 2 Waiting: 17
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.