Analyzer ngx-mem-pools

Name

ngx-mem-pools - Nginx Memory Pool Statistics

This analyzer monitors memory pool usage in OpenResty, Kong, and Nginx applications. It captures allocation statistics from Nginx’s memory pool subsystem, tracking pool sizes and usage patterns. The analyzer generates pie charts showing memory distribution across different pools, helping identify memory-intensive request handlers and optimize memory pool configuration.

Resource Category

Memory.

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-mem-pools -p PID

# trace a shell command directly
orxray analyzer run ngx-mem-pools -c SHELL_CMD

Tracing Multiple Processes

Not supported.

Output Formats

  • Pie Charts
  • Plain Texts

Output Example

{
  "stats": {
      "cycle": {
          "used": { "count": 62, "min": 4112, "max": 33558528, "sum": 34659877 },
          "pools": { "count": 1, "min": 34668784, "max": 34668784, "sum": 34668784 },
          "free": { "count": 7, "min": 1, "max": 8800, "sum": 8907 }
      },
      "http_c": {
          "used": { "count": 16, "min": 312, "max": 16400, "sum": 85344 },
          "pools": { "count": 4, "min": 21536, "max": 21536, "sum": 86144 },
          "free": { "count": 4, "min": 200, "max": 200, "sum": 800 }
      },
      "http_r": {
          "used": { "count": 24, "min": 80, "max": 16400, "sum": 184743 },
          "pools": { "count": 4, "min": 49184, "max": 49184, "sum": 196736 },
          "free": { "count": 9, "min": 1, "max": 4016, "sum": 11993 }
      },
      "stream_c": {
          "used": { "count": 21, "min": 192, "max": 4112, "sum": 17136 },
          "pools": { "count": 3, "min": 5792, "max": 5792, "sum": 17376 },
          "free": { "count": 6, "min": 16, "max": 64, "sum": 240 } },
      "http_timer": {
          "used": { "count": 28, "min": 64, "max": 7472, "sum": 24912 },
          "pools": { "count": 2, "min": 9344, "max": 15696, "sum": 25040 },
          "free": { "count": 2, "min": 64, "max": 64, "sum": 128 }
      },
      "stream_timer": {
          "used": { "count": 17, "min": 64, "max": 4112, "sum": 7680 },
          "pools": { "count": 1, "min": 7760, "max": 7760, "sum": 7760 },
          "free": { "count": 3, "min": 8, "max": 64, "sum": 80 }
      }
  }
}

Author

The OpenResty Inc. Team.

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