Kong GatewayPrometheus

Prometheus Plugin Memory Bloat

warning
Resource ContentionUpdated Sep 7, 2025

Kong's Prometheus plugin is a memory hog consuming +500MB per worker and adding 2ms latency per request. It periodically scans all entities, causing CPU spikes that can peg CPU at 100%.

How to detect:

Monitor per-worker memory usage and CPU utilization. If Prometheus plugin is enabled and memory usage exceeds baseline by 500MB+ per worker, or if periodic CPU spikes occur without traffic changes, the plugin is the culprit. Check worker thread CPU usage with 'top -H -p $(pgrep nginx)' during spikes.

Recommended action:

Disable Prometheus plugin if not actively used. If metrics are required, export them via StatsD or use global response transformer to disable Kong-Debug headers in production. Consider dedicated observability data planes to isolate Prometheus overhead from production traffic. Use StatsD plugin as lighter alternative.