1. View
The status module must be enabled for Nginx during web interface viewing, that is, when Nginx is installed
With-http_stub_status_module
Configure Nginx. conf and add the following content to the server:
1 2 3 4 5 |
Location/status {stub_status on; access_log/usr/local/nginx/logs/status. log; auth_basic "NginxStatus ";} |
After configuring Nginx, you can access http: // localhost/status in the browser to view the following information:
Nginx load command
1 2 |
/Usr/local/nginx/sbin/nginx-t # Check whether the configuration file is incorrect/usr/local/nginx/sbin/nginx-s reload # reload the configuration file |
View the result description:
1 2 3 4 5 |
Active connections // number of Active connections currently being processed by Nginx. server accepts handledrequests // processes a total of 5823 connections, successfully creates 5823 handshakes, and processes a total of 7806 requests. reading // Number of headers that nginx reads to the client. writing // Number of headers that nginx returns to the client. waiting // when keep-alive is enabled, this value is equal to active-(reading + writing), meaning Nginx has processed the resident connection Waiting for the next request command. |
2. View through commands
View commands
1 |
$ Netstat-n | awk '/^ tcp/{++ S [$ NF]} END {for (a in S) print a, S [a]}' |
Result
1 2 3 4 5 6 7 |
TIME_WAIT 17 ESTABLISHED 3254 LAST_ACK 236 FIN_WAIT_1 648 FIN_WAIT_2 581 CLOSING 7 CLOSE_WAIT 4916 |
Result description
1 2 3 4 5 6 7 8 9 10 11 |
CLOSED // No connection is active or LISTEN is in progress // the server is waiting for the incoming call SYN_RECV // a connection request has arrived, waiting for confirmation that SYN_SENT // The application has started, open a connection to ESTABLISHED // normal data transmission status/current number of concurrent connections FIN_WAIT1 // The application says it has completed FIN_WAIT2 // the other side has agreed to release ITMED_WAIT // wait until all groups die CLOSING // both sides attempt to disable TIME_WAIT at the same time // the other side has initialized a release LAST_ACK // wait until all groups die |