網站首頁 編程語言 正文
1. stub_status 作用說明
編譯選項 | 作用 |
---|---|
–with-http_stub_status_module | Nginx的客戶端狀態 |
2.查看現有 nginx 編譯參數
./nginx -V
# 如果沒有我們需要的模塊,例如本次試驗添加的 –with-http_stub_status_module ,那么則需要重新編譯安裝一下
3.使用參數重新配置configure,在原有基礎上添加上 --with-http_stub_status_module
configure 文件是在安裝包目錄下的文件,具體可參考 centos 7 安裝 nginx
./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_ssl_module --with-pcre --with-stream --with-http_stub_status_module
4.將原來的 nginx 文件備份
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
5. 編譯
make
# 這里是需要 make 編譯,不用 make install
6. 替換nginx二進制文件
# 找到 nginx 安裝包目錄 /root/nginx-1.10.1/objs ,將 nginx 文件復制到原本的 /usr/local/nginx/sbin/nginx
cp /root/nginx-1.10.1/objs/nginx /usr/local/nginx/sbin/
7.重新啟動nginx,查看編譯參數
./nginx -s reload
./nginx -V
8. 參考官網
地址:https://nginx.org/libxslt/en/docs/http/ngx_http_stub_status_module.html
8.1 修改配置文件
文件目錄:/usr/local/nginx/conf
# 在文件中添加新的 location
location /nginx_status {
stub_status;
}
# 解釋說明:
nginx_status 這是自定義命名的,訪問的時候添加這個字段訪問
stub_status; 這個是固定參數
8.2 瀏覽器訪問
http://192.168.169.131/nginx_status
# 訪問內容結果如下圖
# 解釋說明:
1)Active connections-活躍連接數
The current number of active client connections including Waiting connections.
(2)accepts-已接受的客戶端連接總數
The total number of accepted client connections.
(3)handled-已處理的連接總數
The total number of handled connections. Generally, the parameter value is the same as acceptsunless some resource limits have been reached (for example, the worker_connections limit).
(4)requests-客戶端連接總數
The total number of client requests.
(5)Reading-讀取請求頭的當前連接數
The current number of connections where nginx is reading the request header.
(6)Writing-將響應寫回客戶端的當前連接數
The current number of connections where nginx is writing the response back to the client.
(7)Waiting-等待請求的當前空閑客戶端連接數
The current number of idle client connections waiting for a request.
參考官網地址:https://nginx.org/libxslt/en/docs/http/ngx_http_stub_status_module.html
原文鏈接:https://blog.csdn.net/D1179869625/article/details/124884978
相關推薦
- 2022-06-23 Android?Socket實現多個客戶端聊天布局_Android
- 2022-07-16 python中文文本切詞Kmeans聚類_python
- 2022-05-10 spring管理事務@Transactional注解相關參數
- 2022-04-14 如何解決:git push error: failed to push some refs to
- 2024-01-27 DO、DTO、BO、VO、POJO區別
- 2022-12-02 Linux下的自動化構建工具之make/makefile的用法詳解_linux shell
- 2022-11-12 超詳細解析C++實現快速排序算法的方法_C 語言
- 2022-11-07 react使用websocket實時通信方式_React
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支