How do you troubleshoot high CPU usage on a Linux server?

Medium Topic: Linux May 24, 2026

Systematic CPU investigation:

  1. top / htop: Identify the process consuming CPU. Note: is it user space or kernel (%us vs %sy)?
  2. ps aux –sort=-%cpu: Snapshot of top CPU consumers.
  3. perf top: See which kernel functions are hot.
  4. strace -p <PID>: Trace system calls to understand what a process is doing.
  5. vmstat 1: Observe context switches (cs) and interrupts (in).

Common causes: runaway application bug, CPU-intensive query (full table scan), kernel work from high I/O (softirqs), insufficient CPU for the workload.

← Previous What is the difference between a hard link... Next → Write a Bash script to find and delete...

Practice Similar Questions

Back to Linux Topics