简体   繁体   中英

How to get current worker connections being used by nginx?

Nginx.conf, looks like this

user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
        worker_connections 768;
        # multi_accept on;
}

The command ulimit -n gives the number of worker connections available, I want the number which is currently being used by nginx.

The ngx_http_stub_status_module module provides access to basic status information.

location /basic_status {
    stub_status;
}

This configuration creates a simple web page with basic status data which may look like as follows:

Active connections: 291 
server accepts handled requests
 16630948 16630948 31070465 
Reading: 6 Writing: 179 Waiting: 106 

Source:https://nginx.org/en/docs/http/ngx_http_stub_status_module.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM