Analyzer ngx-read-req-body-time

Name

ngx-read-req-body-time - Nginx Request Body Reading Time Distribution

This analyzer measures the time Nginx spends reading HTTP request bodies from clients in OpenResty, Kong, and APISIX deployments. It captures the duration of ngx_http_read_client_request_body() operations, filtering by configurable latency thresholds, host names, and URIs. The analyzer generates histogram and table visualizations showing timing distributions, helping identify slow client uploads, network congestion, or issues with large payload processing.

Resource Category

Latency.

Application Type & Technical Stack

  • OpenResty
  • 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-read-req-body-time -p PID

# trace a shell command directly
orxray analyzer run ngx-read-req-body-time -c SHELL_CMD

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

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

Tracing Multiple Processes

Supported.

Output Formats

  • Histogram Bar Charts
  • Tables
  • Plain Texts

Output Example

[{
  "title": "Nginx Request Body Reading Time Distribution",
  "subtitle": "42 Calls (min: 8 us, avg: 12 us, max: 42 us)",
  "type": "dist-bar",
  "ver": 1,
  "series": {
    "data": {"2": 0, "4": 0, "8": 40, "16": 1, "32": 1, "64": 0, "128": 0},
    "categoryUnit": "us",
    "categoryTitle": "Elapsed time",
    "name": "Calls"
  },
  "summary": {"avg": 12, "max": 42, "min": 8, "cnt": 42},
  "kind": "ngx-read-req-body-time"
}]

Author

The OpenResty Inc. Team.

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