
CPU Spike? Rapidly Pinpoint the Culprit Process & Thread with top, perf & jstack
This comprehensive guide walks through a systematic CPU spike troubleshooting workflow: confirm anomaly with top/htop, identify the top-consuming process and thread, analyze thread activity via strace, perf, jstack, py-spy, or pprof, correlate with monitoring metrics, and resolve common scenarios like infinite loops, lock contention, frequent GC, slow queries, cron jobs, and malware.