小谈nginx

Nginx查看并发方案一:Web页面查看

 

1:查看安装的nginx 启用了--with-http_stub_status_module 模块

     nginx -V

2:按照下图配置

 vim /etc/nginx/nginx.conf

 server{

  stub_status on;

 3:保存并从新载入nginx配置文件

     nginx -t  

     nginx -s reload

4:本地验证

 ip/status

----------------------------------

Active connections :2

server accepts handled requests

5104 5104 5007

reading:0writing: 1 waiting: 1

 

第一行#当前正在处理的活动链接数【并发数】

第二行#总共处理5104个连接 成功创建了5104次握手    共处理5007个请求

读取到客户端header信息数   返回数   等待处理

 

 方案二:命令查看

netstat  -apn|grep ‘nginx: worker’ | wc -l

 

posted @ 2024-07-10 10:28  uksmd  阅读(5)  评论(0编辑  收藏  举报