Skip to content

How to collect a trace and heap from nginx ingress

This document (000020176) is provided subject to the disclaimer at the end of this document.

Situation

Task

When troubleshooting an ingress-nginx issue, collecting the trace and heap dump from ingress-nginx Pods may be requested. This can assist with understanding issues like excessive memory consumption.

Pre-requisites

Access to the node(s) where the ingress-nginx Pods are experiencing the issue, or access to the node on 10254/TCP from a workstation.

To collect the output, the below commands use curl, you may need to install the package. If needed, wget could be used instead.

The date command is used to provide a consistent timestamp for the files, this could be changed or removed if the date command on the node doesn't support these flags.

The issue should be occurring at the time for the collection to be useful when investigating.

Steps

SSH to the node(s), use the following commands to collect the trace and heap dump. If the issue is intermittent or fluctuating, repeat the commands as necessary to capture the collection when the issue is ocurring.

Heap
curl -s http://localhost:10254/debug/pprof/trace?seconds=5 --output /tmp/nginx-trace.$(date -u --iso-8601=seconds)
Trace
curl -s http://localhost:10254/debug/pprof/heap --output /tmp/nginx-heap.$(date -u --iso-8601=seconds)

Note: if accessing the node on 10254/TCP instead, be sure to update localhost with the IP Address of the node.

If the files are too large to upload to the ticket, please request or use the provided temporary upload location.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.