Analyzer ngx-req-distribution

Name

ngx-req-distribution - Nginx Traffic Distribution By Calls of Finalize Request

This analyzer monitors request traffic distribution in nginx-based applications such as OpenResty and Kong by tracking calls to the request finalization function. It captures the frequency and patterns of request completion across different processing phases and handlers. The analyzer generates bar chart visualizations showing traffic distribution patterns, helping administrators understand request flow, identify load imbalances, and optimize request handling logic for better resource utilization.

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-req-distribution -p PID

# trace a shell command directly
orxray analyzer run ngx-req-distribution -c SHELL_CMD

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

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

Tracing Multiple Processes

Supported.

Output Formats

  • Bar Charts
  • Plain Texts

Output Example

[
  {
    "title": "Close Requestes Distribution By Listen Ports",
    "subtitle": "",
    "series": {
      "data": {
        "0.0.0.0": 9092
      },
      "name": "Calls of finalize_request"
    },
    "ver": 1,
    "type": "bar"
  }
]

Author

The OpenResty Inc. Team.

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