Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use stub_status to realize a module monitoring function in Nginx

Shulou Source: shulou.com Published: 2022-06-02 00:19:42 11月02日 Update

Today, I will talk to you about how to use stub_status to achieve a module monitoring function in Nginx. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Functions realized by the module

Through this module, you can see the following Nginx status information:

Active connections: 2server accepts handled requests 62 62 102Reading: 0 Writing: 1 Waiting: 0

Where:

Active connections: number of active connections

Accepts: number of requests allowed

Handled: number of requests processed

Requests: total number of requests

Reading: the number of Header messages read to the client

Writing: the number of Header messages returned to the client

Waiting: when keep-alive is enabled, this value is equal to (Active minus Reading minus Writing), indicating that Nginx has responded to those requests and is waiting for the resident connection of the next request instruction.

When the access frequency is high and the request is processed quickly, it is normal for the Waiting to be large; if the Reading + Writing is large, it means that the number of concurrent visits is large.

Installation module

The Nginx source code of this module is included, but it will not be compiled by default. You need to enable this compilation parameter:

-- with-http_stub_status_module

Enable Modul

To enable this module, simply write a line in the site configuration:

Stub_status on

Take my configuration as an example:

Location = / status/ {stub_status on;} after reading the above, do you have any further understanding of how to use stub_status to implement a module monitoring function in Nginx? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Modules functions large information content monitoring client side processing compilation configuration one line parameters situation instructions more being source code status knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Docker Microsoft NVidia Apple