!
也想出现在这里? 联系我们
广告位
当前位置:首页>教程分享>服务器教程>云服务器安装nginx的stub_status模块

云服务器安装nginx的stub_status模块

[root@web1 ~]# vim /usr/local/nginx/conf/nginx.conf

47 location /status {

48 stub_status on;

49 }

# 检查语法,出现syntax is ok表示配置文件正确

[root@web1 ~]# /usr/local/nginx/sbin/nginx -t

# 启动服务

[root@web1 ~]# /usr/local/nginx/sbin/nginx

[root@web1 ~]# ss -tlnp | grep :80

LISTEN 0 128 *:80

# 访问监控页面

[root@web1 ~]# curl http://192.168.4.100/status

Active connections: 1

server accepts handled requests

1 1 1

Reading: 0 Writing: 1 Waiting: 0

# Activeconnections:当前客户端与nginx之间的连接数。它等于下面Reading / Writing/ Waiting之和

# accepts:自nginx启动之后,客户端访问的总量

# handled:自nginx启动之后,处理过的客户端连接总数。

# requests:自nginx启动之后,处理过的客户端请求总数。

# Reading:正在读取HTTP请求头部的连接总数。

# Writing:正在向客户端发送响应的连接总数。

# Waiting:空闲连接。

# 使用工具向服务器发起多个请求

[root@web1 ~]# yum install -y httpd-tools

# 一共发1000个请求,每次并发数100

[root@web1 ~]# ab -n 1000 -c 100 http://192.168.4.100/status

[root@web1 ~]# curl http://192.168.4.100/status

Active connections: 1

server accepts handled requests

1040 1040 1004

Reading: 0 Writing: 1 Waiting: 0

给TA打赏
共{{data.count}}人
人已打赏
服务器教程

云服务器Linux系统安全加固教程

2021-4-17 17:47:09

服务器教程

香港云服务器不能正常关机/重启的原因有哪些

2021-4-17 17:47:11

声明 本站上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。无意侵害您的权益,请发送邮件至 [email protected] 或点击右侧 私信:吉吉国王 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
OneEase