Last Updated: May 04, 2019
· ninowalker

diagnose CPU churn with strace

$ strace -p <pid>

Your process is spinning. You're not sure what it's doing. You can't kill it or attach a remote debugger. Use strace.

You'll see network, disk reads, and other system calls. You may see a simple "recv(..." meaning your process is waiting for data on a socket. There's a good chance that with this little bit of evidence - if you use your brain - that you'll know what the hell is going on.

Or at least know where to look next. Because sometimes, that's all you need.

1 Response
Add your response

Good tip. On mac OSX you can do:

dtruss -p <pid>
over 1 year ago ·