Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report