-
Notifications
You must be signed in to change notification settings - Fork 845
Taking a Heap, CPU or other profile Dump
To analyze one of the pprof profiles available for Go for Concourse we can leverage http:https://127.0.0.1:DEBUG_BIND_PORT/debug/pprof
endpoint. The value of DEBUG_BIND_PORT
depends on what process you are inspecting. For the web
process, the default port is 8079
. For the worker
process, the default port is 7076
. These values can be overridden by the CONCOURSE_DEBUG_BIND_PORT
environment variable.
For example to get a heap dump, run;
curl http:https://localhost:8079/debug/pprof/heap > DUMP_FILE
curl http:https://localhost:7776/debug/pprof/heap > DUMP_FILE
Or if you are looking for the MemStats, run;
curl http:https://localhost:8079/debug/pprof/heap?debug=1 > DUMP_FILE
curl http:https://localhost:7776/debug/pprof/heap?debug=1 > DUMP_FILE
This can be analyzed using;
go tool pprof -http :SOME_PORT_NUMBER PATH_TO_DUMP_FILE
- For MemStats, open the
DUMP_FILE
with a text editor and look at the# runtime.MemStats
section. This is only available when passing thedebug=1
query param to the pprof endpoint. -
go tool pprof
has-diff_base
and-base
to compare profiles