Linux Process Debugging
A process is consuming 100% CPU on a Linux server. Walk me through how you would identify and troubleshoot this issue.
Linux Process Debugging
A process is consuming 100% CPU on a Linux server. Walk me through how you would identify and troubleshoot this issue.
Start with top or htop to identify the process. Use ps aux to get details. Check strace to see system calls, lsof for open files, and /proc/<pid>/ for process info. For Java/Python, get thread dumps. Check logs, and consider perf or flamegraphs for deep analysis. May indicate infinite loops, memory leaks, or resource contention.
Systematic troubleshooting is essential for production issues. Starting with broad tools (top) and narrowing down (strace, perf) helps identify root causes efficiently. Understanding Linux process management and debugging tools is a core DevOps skill.
Identify high CPU process
Deep process analysis
- Immediately killing the process without investigating the root cause
- Not checking if the high CPU is expected (batch job, build process)
- Forgetting to check system logs before diving into process-level debugging
- How would you generate a thread dump for a Java application?
- What is the difference between CPU user time and system time?
- How do you identify if the issue is I/O bound vs CPU bound?