Analyzer openresty-lua-phase-wall-time

Name

openresty-lua-phase-wall-time - OpenResty Lua Phase wall time statistics

This analyzer collects wall-clock time statistics for different Lua execution phases in OpenResty-based applications. It measures elapsed time in each request processing phase (e.g., rewrite, access, content, log phases), capturing both CPU and I/O wait time. The analyzer helps identify slow phases, detect blocking operations, and understand the overall latency contribution of each phase to request processing time.

Resource Category

Network I/O.

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 openresty-lua-phase-wall-time -p PID

# trace a shell command directly
orxray analyzer run openresty-lua-phase-wall-time -c SHELL_CMD

# PGID is the process group ID or any process's PID within the target process
# group.
orxray analyzer run openresty-lua-phase-wall-time -p -PGID

# trace any processes started from the specified executable path.
orxray analyzer run openresty-lua-phase-wall-time --exe /path/to/exe/file

Tracing Multiple Processes

Supported.

Output Formats

  • Plain Texts

Output Example

[
  {
    "title": "Time Distribution of Access Phase",
    "subtitle": "3 samples (min: 21455 us, avg: 26887 us, max: 35798 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"4096": 0, "8192": 0, "16384": 2, "32768": 1, "65536": 0, "131072": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 21455, "max": 35798, "avg": 26887, "cnt": 3},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of Log Phase",
    "subtitle": "36 samples (min: 110 us, avg: 361 us, max: 727 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"16": 0, "32": 0, "64": 1, "128": 4, "256": 28, "512": 3, "1024": 0, "2048": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 110, "max": 727, "avg": 361, "cnt": 36},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of Header filter Phase",
    "subtitle": "37 samples (min: 31 us, avg: 110 us, max: 274 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"4": 0, "8": 0, "16": 1, "32": 2, "64": 25, "128": 7, "256": 2, "512": 0, "1024": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 31, "max": 274, "avg": 110, "cnt": 37},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of Body filter Phase",
    "subtitle": "36 samples (min: 5 us, avg: 7557 us, max: 107897 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"1": 0, "2": 0, "4": 9, "8": 2, "16": 4, "32": 1, "64": 5, "128": 9, "256": 3, "512": 0, "1024": 0, "16384": 0, "32768": 0, "65536": 3, "131072": 0, "262144": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 5, "max": 107897, "avg": 7557, "cnt": 36},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of Balancer Phase",
    "subtitle": "33 samples (min: 176 us, avg: 4708 us, max: 37126 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"32": 0, "64": 0, "128": 6, "256": 19, "512": 2, "1024": 0, "2048": 1, "4096": 1, "8192": 0, "16384": 1, "32768": 3, "65536": 0, "131072": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 176, "max": 37126, "avg": 4708, "cnt": 33},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of SSL cert Phase",
    "subtitle": "2 samples (min: 51 us, avg: 67 us, max: 84 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"8": 0, "16": 0, "32": 1, "64": 1, "128": 0, "256": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 51, "max": 84, "avg": 67, "cnt": 2},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of Session store Phase",
    "subtitle": "2 samples (min: 32 us, avg: 40 us, max: 49 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"8": 0, "16": 0, "32": 2, "64": 0, "128": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 32, "max": 49, "avg": 40, "cnt": 2},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of SSL client hello Phase",
    "subtitle": "2 samples (min: 77 us, avg: 103 us, max: 130 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"16": 0, "32": 0, "64": 1, "128": 1, "256": 0, "512": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 77, "max": 130, "avg": 103, "cnt": 2},
    "kind": "openresty-lua-phase-time-stat"
  },
  {
    "title": "Time Distribution of Total Phase",
    "subtitle": "36 samples (min: 5 us, avg: 7557 us, max: 107897 us)",
    "type": "dist-bar",
    "ver": 1,
    "series": {
      "data": {"1": 0, "2": 0, "4": 9, "8": 2, "16": 4, "32": 1, "64": 5, "128": 9, "256": 3, "512": 0, "1024": 0, "16384": 0, "32768": 0, "65536": 3, "131072": 0, "262144": 0},
      "categoryTitle": "cost time",
      "name": "samples",
      "categoryUnit": "us"
    },
    "summary": {"min": 5, "max": 107897, "avg": 7557, "cnt": 36},
    "kind": "openresty-lua-phase-time-stat"
  }
]

Author

The OpenResty Inc. Team.

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