Skip to content

Instantly share code, notes, and snippets.

@enkuso
Created September 13, 2017 09:44
Show Gist options
  • Save enkuso/beb1613eae7b7b492faa3595d11b441a to your computer and use it in GitHub Desktop.
Save enkuso/beb1613eae7b7b492faa3595d11b441a to your computer and use it in GitHub Desktop.
nginx: See Active connections / Connections Per Seconds
# NGINX config
location /nginx_status {
# Turn on stats
stub_status on;
access_log off;
# only allow access from 192.168.1.5 #
allow 192.168.1.5;
deny all;
}
Sample outputs:
Active connections: 2
server accepts handled requests
7 7 12
Reading: 0 Writing: 1 Waiting: 1
2 = Number of all open connections
7 = Accepted connections
7 = Handled connections
12 = Handles requests
How do I calculate connections per seconds?
Requests per connection = handles requests / handled connections
Requests per connection = 21897888/9582571 (pass this to bc -l using echo '21897888/9582571' | bc -l command)
Requests per connection = 2.28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment