Monitor the Nginx service status using stub_status

V Records 2,089 Views , No comment

1.stub_status Module installation

Use the command first to check if this module has been installed:

Uppercase -V will display information such as version number and module, and lowercase -v will only display version information.

If the stub_status module is already installed, the following information will be displayed.

2.Nginx configuration

Just modify the nginx configuration after installation, the configuration is as follows:

By default, there is only local access. If you want to be able to view the status remotely, you need to add a remote IP or remove “Deny all”. Encrypted files can be created using the

command. After the configuration is complete, you need to restart the Nginx service.

The state configuration can only be for a certain Nginx service. Currently Nginx is unable to monitor individual sites.

3.View nginx Status

After the configuration is complete, enter http://127.0.0.1/nginxerstatus in the browser to view:

4.Nginx status parameter description

Active connections – the number of active connections

Server accepts handled requests — A total of 10,812,128 connections were processed, 10,565,289 handshakes were successfully created, and a total of 38,869,088 requests were processed.

There are three states for each connection:

Reading — Reads the number of Header messages on the client. This operation simply reads the header information and immediately enters the writing state after reading, so the time is short.

Writing — The number of header information in response to the data to the client. This operation not only reads the header, but also waits for the service response, so the time is longer.

Waiting — Wait for the next connection to the next request command after the keep-alive is turned on.

Under normal circumstances, the number of waiting is relatively large, and does not indicate poor performance. On the contrary, if the number of reading + writing is more, the service may have concurrency problems.

View the number of Nginx concurrent processes:

View the web server TCP connection status:


This article was first published by V on 2018-10-13 and can be reprinted with permission, but please be sure to indicate the original link address of the article :http://www.nginxer.com/records/monitor-the-nginx-service-status-using-stub_status/

Leave a Reply

Your email address will not be published. Required fields are marked *

Go