nginx状态监控以及配置
来源:互联网 发布:人工智能电影地址 编辑:程序博客网 时间:2024/05/18 14:43
在配置文件 /usr/local/server/nginx/conf/nginx.conf中添加
#设定查看Nginx状态的地址,添加如下
location /NginxStatus {
stub_status on;
access_log on;
auth_basic "NginxStatus";
auth_basic_user_file conf/htpasswd;
}
其中密码文件中每条用户名和密码的格式为: user:password
该密码文件不能由用户直接指定,需要通过apache的btpasswd生成密码
生成密码的指令为:
/usr/local/apache2/htpasswd -bc /export/servers/nginx/conf/htpasswd usr1 passwd1
输入地址 http://10.0.0.1/NginxStatus/,输入验证帐号密码,即可
==============================================
无密码,限访问IP
location /nginx_status {
stub_status on;
access_log off;
allow all;
#设定查看Nginx状态的地址,添加如下
location /NginxStatus {
stub_status on;
access_log on;
auth_basic "NginxStatus";
auth_basic_user_file conf/htpasswd;
}
其中密码文件中每条用户名和密码的格式为: user:password
该密码文件不能由用户直接指定,需要通过apache的btpasswd生成密码
生成密码的指令为:
/usr/local/apache2/htpasswd -bc /export/servers/nginx/conf/htpasswd usr1 passwd1
输入地址 http://10.0.0.1/NginxStatus/,输入验证帐号密码,即可
==============================================
无密码,限访问IP
location /nginx_status {
stub_status on;
access_log off;
allow all;
}
解析:
Active connections //当前 Nginx 正处理的活动连接数。
server accepts handledrequests //总共处理了8 个连接 , 成功创建 8 次握手,总共处理了500个请求。
Reading //nginx 读取到客户端的 Header 信息数。
Writing //nginx 返回给客户端的 Header 信息数。
Waiting //开启 keep-alive 的情况下,这个值等于 active – (reading + writing),意思就是 Nginx 已经处理完正在等候下一次请求指令的驻留连接
No2、通过命令查看
#netstat -n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}’TIME_WAIT 17
ESTABLISHED 3254
LAST_ACK 236
FIN_WAIT_1 648
FIN_WAIT_2 581
CLOSING 7
CLOSE_WAIT 4916解析:
CLOSED //无连接是活动的或正在进行
LISTEN //服务器在等待进入呼叫
SYN_RECV //一个连接请求已经到达,等待确认
SYN_SENT //应用已经开始,打开一个连接
ESTABLISHED //正常数据传输状态/当前并发连接数
FIN_WAIT1 //应用说它已经完成
FIN_WAIT2 //另一边已同意释放
ITMED_WAIT //等待所有分组死掉
CLOSING //两边同时尝试关闭
TIME_WAIT //另一边已初始化一个释放
LAST_ACK //等待所有分组死掉
- nginx状态监控以及配置
- Nginx状态图形化监控工具,Nginx-rrd+rrdtool 配置
- 开启nginx状态监控
- nginx状态监控
- nginx状态监控
- nginx状态监控
- 开启nginx状态监控
- 启用Nginx状态监控
- 开启nginx状态监控
- nginx状态监控
- nginx状态监控
- 开启nginx状态监控
- 启用Nginx状态监控
- zabbix监控Nginx状态
- Nginx服务状态监控
- zabbix监控nginx状态
- SNMP对nginx 状态监控
- nginxtop实时监控nginx状态
- [LeetCode] LRU Cache
- hibernate的环境搭建
- 资源池设计模式 (Resource Pool)和数据池的简单实现
- 生活习惯不好
- 字符串String整形Int互相转换
- nginx状态监控以及配置
- Redis作者谈Redis应用场景
- Epic面试题,Spiral打印一个N*N的矩阵
- Redis 常见的性能问题和解决方法
- Linux下查看Apache的请求数
- 【所有子序列问题】
- redis读写性能测试
- 基于php-fpm的配置详解
- Lambda + KeyValuePair Create a new Class