Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrahon/3ac2d2d62093732b209b50f8d2f72c9c to your computer and use it in GitHub Desktop.
Save adrahon/3ac2d2d62093732b209b50f8d2f72c9c to your computer and use it in GitHub Desktop.
How to run go pprof on Docker daemon
Enable port 8080 through the firewall:
firewall-cmd --add-port=8080/tcp
Run socat to make docker sock available via tcp port (note the IP to listen at)
socat -d -d TCP-LISTEN:8080,fork,bind=192.168.122.214 UNIX:/var/run/docker.sock
Run pprof on your client:
go tool pprof http://192.168.122.214:8080/debug/pprof/profile
Fetching profile from http://192.168.122.214:8080/debug/pprof/profile
Please wait... (30s)
Saved profile in /home/kir/pprof/pprof.192.168.122.214:8080.samples.cpu.002.pb.gz
Entering interactive mode (type "help" for commands)
(pprof) web
(pprof) web ploop
(pprof)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment