Analyzer ngx-epoll-event-stats
Name
ngx-epoll-event-stats - Statistics of Epoll Events Received
This analyzer collects statistics on epoll events received by Nginx-based applications including OpenResty and Kong. It tracks the types and frequencies of epoll events such as EPOLLIN, EPOLLOUT, and EPOLLERR, providing detailed metrics about event distribution. The analyzer helps understand I/O patterns and diagnose issues related to network event handling in the event loop.
Resource Category
CPU.
Application Type & Technical Stack
- OpenResty
- Nginx
- Kong
- APISIX
Command Line Syntax
The analyzer can be invoked directly on the command-line via the orxray
utility from the openresty-xray-cli software package.
Alternatively, the analyzer can also be invoked manually or automatically on the web console UI of OpenResty XRay (like on the Advanced web page).
# PID is the target process PID.
orxray analyzer run ngx-epoll-event-stats -p PID
# trace a shell command directly
orxray analyzer run ngx-epoll-event-stats -c SHELL_CMD
Tracing Multiple Processes
Not supported.
Output Formats
- Plain Texts
Output Example
[
{
"type": "table",
"data": [
[ "Metric", "Value" ],
[ "total exceptions", "1036" ],
[ "total sample count", "1000" ],
[ "read event instance errors", "0" ],
[ "write event instance errors", "0" ]
],
"title": "Summary",
"ver": 1
},
{
"type": "table",
"data": [
[ "Event", "Count" ],
[ "ngx_http_upstream_handler", "325" ],
[ "ngx_http_request_handler", "268" ],
[ "ngx_event_accept", "95" ],
[ "ngx_http_keepalive_handler", "40" ],
[ "ngx_quic_recvmsg", "40" ],
[ "ngx_ssl_handshake_handler", "29" ],
[ "ngx_http_ssl_handshake", "21" ],
[ "ngx_http_lua_socket_tcp_handler", "13" ],
[ "ngx_http_lingering_close_handler", "11" ],
[ "ngx_http_v2_idle_handler", "6" ]
],
"title": "Top 10 read event handlers by counts",
"ver": 1
},
{
"type": "table",
"data": [
[ "Event", "Count" ],
[ "ngx_http_upstream_handler", "325" ],
[ "ngx_http_request_handler", "268" ],
[ "ngx_http_empty_handler", "82" ],
[ "ngx_ssl_handshake_handler", "29" ],
[ "ngx_http_lua_socket_tcp_handler", "13" ],
[ "ngx_stream_lua_request_handler", "1" ],
[ "ngx_http_lua_balancer_dummy_handler", "1" ]
],
"title": "Top 10 write event handlers by counts",
"ver": 1
},
{
"type": "table",
"data": [
[ "fd", "Count" ],
[ "38", "93" ],
[ "241", "85" ],
[ "295", "54" ],
[ "294", "51" ],
[ "40", "40" ],
[ "169", "37" ],
[ "114", "36" ],
[ "110", "35" ],
[ "63", "33" ],
[ "226", "32" ]
],
"title": "Top 10 fd by counts",
"ver": 1
},
{
"type": "table",
"data": [
[ "fd", "Count" ],
[ "", "1722" ],
[ "DIR", "85" ],
[ "R", "69" ],
[ "I", "14" ]
],
"title": "Top 20 connection flags(Close, Destroyed, Error, Idle, Reusable, Shared, Timeout)",
"ver": 1
},
{
"type": "table",
"data": [
[ "fd", "Count" ],
[ "EPOLLIN EPOLLOUT ", "614" ],
[ "EPOLLIN ", "195" ],
[ "EPOLLOUT ", "33" ],
[ "EPOLLIN EPOLLRDHUP 10", "5" ],
[ "EPOLLIN EPOLLOUT EPOLLRDHUP ", "3" ],
[ "EPOLLIN EPOLLOUT EPOLLRDHUP 10", "3" ],
[ "EPOLLIN EPOLLRDHUP EPOLLERR 10", "1" ]
],
"title": "Top 10 events by counts",
"ver": 1
}
]
Author
The OpenResty Inc. Team.
Copyright
Copyright (C) by OpenResty Inc. All rights reserved.