Analyzer epoll-wait-timers

Name

epoll-wait-timers - Wait timers for epoll

This analyzer profiles the timeout parameter distribution of epoll_wait and epoll_pwait system calls. It captures the timeout values (in milliseconds) passed to these calls, revealing the application’s event loop timeout strategy. A timeout of -1 indicates blocking mode (wait indefinitely), 0 means non-blocking (return immediately), and positive values specify maximum wait time. This helps identify polling patterns: aggressive polling (frequent short timeouts) may waste CPU, while overly long timeouts may reduce responsiveness. Understanding these patterns enables optimization of event loop efficiency and resource utilization.

Resource Category

CPU.

Application Type & Technical Stack

  • All

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 epoll-wait-timers -p PID

# trace a shell command directly
orxray analyzer run epoll-wait-timers -c SHELL_CMD

# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run epoll-wait-timers -p -PGID

# trace any processes started from the specified executable path.
orxray analyzer run epoll-wait-timers --exe /path/to/exe/file

Tracing Multiple Processes

Supported.

Output Formats

  • Plain Texts

Output Example

{
  "data": {
    "min": "0", "max": "100", "avg": "45",
    "distributions": {
      "0": 5, "1": 11, "2": 31, "4": 70, "8": 95,
      "16": 213, "32": 342, "64": 318, "128": 0, "256": 0
    },
    "total": "1660"
  },
  "kind": "epoll-wait-timers"
}

Author

The OpenResty Inc. Team.

Copyright (C) by OpenResty Inc. All rights reserved.