Analyzer ngx-top-latency-reqs

Name

ngx-top-latency-reqs - IP packets of top latency HTTP requests

This analyzer captures network packets for HTTP requests with the highest latency in Nginx-based applications. It monitors network traffic at the IP layer and identifies requests exceeding a configurable latency threshold. The analyzer records complete packet data for top latency requests, enabling detailed protocol-level analysis of slow HTTP transactions. This helps diagnose network-related performance issues, protocol anomalies, and request processing delays.

Resource Category

Network I/O.

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-top-latency-reqs -p PID

# trace a shell command directly
orxray analyzer run ngx-top-latency-reqs -c SHELL_CMD

# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run ngx-top-latency-reqs -p -PGID

# trace any processes started from the specified executable path.
orxray analyzer run ngx-top-latency-reqs --exe /path/to/exe/file

Tracing Multiple Processes

Supported.

Output Formats

  • Bar Charts
  • Plain Texts

Output Example

{
  "flows": [
      {
          "flow": "flow_0.pcap",
          "req_time": "93",
          "desc": "Event Time: Thu, 04 Dec 2025 14:28:27 GMT\nTotal request time: 93 ms\nUpstream local address: 172.31.25.167:59822\nUpstream remote address: 9.9.9.9:443\nHTTP request: 'GET https:\/\/ntest.com\/api\/agents\/3198\/applications?discarded=false'",
          "remote_addr": "9.9.9.9 443",
          "packets_count": "12",
          "local_addr": "172.31.25.167 59822",
          "status": "200",
          "time": "1764858507175661",
          "tag": "upstream"
      },
      {
          "flow": "flow_5.pcap",
          "req_time": "94",
          "desc": "Event Time: Thu, 04 Dec 2025 14:28:38 GMT\nTotal request time: 94 ms\nUpstream local address: 172.31.25.167:60032\nUpstream remote address: 10.10.10.10 443\nHTTP request: 'GET https:\/\/abc.test.com\/_outlet\/mb'",
          "remote_addr": "10.10.10.10 443",
          "packets_count": "12",
          "local_addr": "172.31.25.167 60032",
          "status": "502",
          "time": "1764858518353151",
          "tag": "upstream"
      }
  ]
}

Author

The OpenResty Inc. Team.

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