Need help with ngx_lua_reqstatus?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

zheng-ji
131 Stars 39 Forks MIT License 20 Commits 3 Opened issues

Description

实时统计 nginx 状态的 lua 拓展

Services available

!
?

Need anything else?

Contributors list

No Data

ngxluareqstatus

实时监控 Nginx 域名的 qps, 5xx 个数,响应时长, 其中

ganglia_conf
目录是 ganglia 监控脚本。

配置
nginx.conf

http {
    ...
    ...

lua_shared_dict statics_dict    1M; # 初始化变量
lua_package_path "/etc/nginx/ngx_lua_reqstatus/?.lua";  #路径
log_by_lua_file "/etc/nginx/ngx_lua_reqstatus/hook.lua"; #  添加此句

server {
    listen 80;
    server_name  justforfun.com; 
    location /{
        ...
    }
}

# 监控服务
server {
    listen 127.0.0.1:6080;
    location /{
        content_by_lua_file "/etc/nginx/ngx_lua_reqstatus/status.lua";
    }
}

}

效果

  • 查看 域名
    justforfun.com
    的qps,5xx个数,平均响应时长:

ganglia

curl localhost:6080/?domain=justforfun.com
  • 输出
Server Name key:    justforfun.com
Seconds SinceLast:  26.601999998093
Average Req Time Sec:   0.031799983978271
Request Count:  5
Requests Per Secs:  0.18795579281101
5xx num:    0
  • 如果对你有帮助, 请我喝杯咖啡吧 :)

wechatqr

license

MIT License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.