Linux Process Debugging
A process is consuming 100% CPU on a Linux server. Walk me through how you would identify and troubleshoot this issue.
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?
More Linux interview questions
- Bash Scripting Basicsjunior
- Environment Variablesjunior
- Linux File Permissionsjunior
- Linux Package Managementjunior
- Linux System Logsjunior
Also worth your time on this topic
Linux System Logs
Where are system logs stored in Linux and how do you view them?
junior
Linux Performance Tuning and Troubleshooting
Master essential Linux performance analysis and optimization techniques to diagnose and resolve system bottlenecks.
80 minutes
How to Measure the Actual Memory Usage of an Application or Process
Learn how to accurately measure real memory usage of processes in Linux, understand the difference between virtual, resident, and shared memory, and use the right tools for memory analysis.