【基本介绍】
这里介绍nginx的stub_status模块,可以查看当前web的连接数,请求数等。
【模块查看】
nginx的stub_status模块支持访问状态的信息。所有要查看该模块是否已经安装。
nginx -V | grep ngx_http_stub_status_module
【基本配置】
location /nginx_status {
stub_status on;
access_log off;
allow xxx
deny all;
}
【内容解释】
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
The following status information is provided:
Active connections(当前客户连接数)
The current number of active client connections including Waiting connections.
accepts(总共接收的客户连接数)
The total number of accepted client connections.
handled(总共处理的连接数)
The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached (for example, the worker_connections limit).
requests(总共请求数)
The total number of client requests.
Reading(当前读取请求头的连接数)
The current number of connections where nginx is reading the request header.
Writing(当前反馈给客户端的连接数)
The current number of connections where nginx is writing the response back to the client.
Waiting(当前连接等待请求数)
The current number of idle client connections waiting for a request.
【其他方式】
还有其他通过命令还来查看连接数的方式,只能是预估并不准确。
[root@sparkVM script]# netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
TIME_WAIT 1
ESTABLISHED 890
[root@sparkVM script]# ps -ef | grep nginx | wc -l
14
【参考引用】
http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
分享到:
相关推荐
fastdfs-nginx-module_v1.16.tar.gz源码包,nginx支持fastdgs的插件
基于nginx1.19.3版本,已编译好nginx-http-flv-module,开箱即用。鄙视那些收C币的。
nginx-1.8.0_linux Linux版0积分免费下载nginx-1.8.0_linux Linux版0积分免费下载nginx-1.8.0_linux Linux版0积分免费下载nginx-1.8.0_linux Linux版0积分免费下载nginx-1.8.0_linux Linux版0积分免费下载nginx-...
nginx sticky是nginx的module,可以实现基于cookie的负载均衡。 下载后,在编译安装nginx时,用--add-module... ./configure --prefix=/usr/local/nginx-1.6.0 --add-module=../nginx-sticky-module-1.25 --without-...
nginx-1.5.8_arm.tar.bz2
FastDFS整合Nginx的模块压缩包。网上好像不好找,这里放一个吧,文件压缩了,下载之后解压即可,不要直接用linux解压命令解压。
FastDFS_v5.05+fastdfs-nginx-module_v1.16+libfastcommonV1.0.7安装包及其依赖包
fastdfs-nginx-module_master.zip正常
ubuntu 20.04 离线安装Nginx(nginx-full_1.18.0)及相关依赖文件
nginx 和 fastdfs 整合在一起安装, 先解压编译安装 libfastcommon-master,fastdfs-6.04,fastdfs-master 然后解压 fastdfs-nginx-module-master,nginx-1.9.11. 请在编译安装nginx-1.9.11前配置 ./configure --prefix=...
windows版,2021年6月23日编译,已编译nginx-http-flv-module直播推流模块
主要介绍了Nginx开启stub_status模块配置方法,Nginx中的stub_status模块主要用于查看Nginx的一些状态信息,本文讲解它的开启配置方法,需要的朋友可以参考下
nginx-1.0.12_ngx-cache-purge1.5.tar.gz
Nginx是由伊戈尔·赛索耶夫为俄罗斯访问量第二的Rambler.ru站点(俄文:Рамблер)开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例...
fastdfs分布式文件系统搭建需要的插件,该插件用于编译nginx的安装,nginx添加的一个模块,用于http访问fastdfs资源。
fastdfs-nginx-module_v1.15.tar.gz