How to collect a trace and heap from nginx ingress

Follow
Table of Contents

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.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.