nginx status Module
Deprecated due to exploit
install just
nginx -V 2>&1 | grep -o with-http_stub_status_module
by default it displays
with-http_stub_status_module
configure
location /nginx_status { stub_status on; access_log off; allow 1.1.1.1; allow 1.1.1.1; deny all; } your app address
ip.com/nginx_status
nginx status page explained
Active connections: 46
server connections till now rom start 54373
accepts 54373
handled requests 57342
Rejected
timedout:
request/s=
handled/accepted
57342/54373=1.054
1 request/s
nginx able to handle 1024 connections per second with single core,
2048 connections with dual core.
2 cpu cores given 54,368 connection per second in a test.
Average requests per server connection in nginx wordpress
Reading: 0 Writing: 1 Waiting: 45
Reading – nginx reads request header
Writing – nginx reads request body, processes request, or writes response to a client
keepalive/waiting =active – (reading + writing)
Disable keepalive to see it as zero.
connections Accepted Per Second
connections Active: Active connections
connections Dropped Per Second
connections Reading and net.connections Writing
connections Waiting
requests Per Second
Note: every connection may have 30+ requests you may see in chrome dev tools.
error log rate /var/log/nginx/error.log
server http connection vs requests
HTTP connections – client and server introduce themselves. tcp handshake
HTTP requests – client ask something from server
1 connection with 5js , 2 css, 10 images browser requests/resources
NGINX Amplify
NGINX Amplify is a free, SaaS based monitoring tool for NGINX Open Source and NGINX Plus.
also able to view mysql, linux, php metrics
https://www.nginx.com/products/nginx-amplify/
monitoring with nginx variables
$request_time and $upstream_response_time (total time taken by nginx and any upstream servers to process a request and send a response)
$upstream_response_time / php fpm or apache with mysql.
new relic & data dogs are freemium monitoring services for your server or application
Reference:
https://www.datadoghq.com/blog/how-to-monitor-nginx/
https://blog.newrelic.com/product-news/how-to-monitor-nginx-performance/