Troubleshoot high CPU on a Linux server over SSH

Use uptime, ps, top and journalctl to identify a busy Linux process, match it to recent logs, and verify that the server recovers.

Requests are timing out and a server graph shows a CPU spike. You have SSH access and need to find out which process is responsible, when it started, and whether it lines up with a deploy, job or error loop.

Sample Harbor screens show the system process view followed by logs, the two places to compare during a slowdown.Play GIFHide GIFSample Harbor screens show the system process view followed by logs, the two places to compare during a slowdown.
Sample Harbor screens show the system process view followed by logs, the two places to compare during a slowdown.

Record the time and find the hot process

Run uptime to capture recent load averages and ps to rank processes by CPU use. Load average includes tasks waiting on some kinds of I/O, so a high number is a prompt to inspect further. ps CPU percentages are averages over process lifetimes. Watch top for several refreshes to see what is busy now and whether the same PID stays near the top.

date -Is
uptime
ps -eo pid,comm,pcpu,pmem --sort=-pcpu | head -n 12
top

Read the service logs in the same window

Identify which service owns the PID. On a systemd host, read the journal for the actual unit name and the time window you observed. In this example, replace your-service.service with that unit. Look for a burst of retries, a scheduled job, or a deploy timestamp. For a containerized process, inspect the container’s own logs and restart history as well.

journalctl -u your-service.service --since '20 minutes ago' --no-pager

Take one action and measure again

Choose the smallest change the evidence supports, such as pausing a known batch job through its scheduler or rolling back a release using your runbook. Capture the PID and log timestamps first. Recheck CPU across several samples and verify whatever the user saw failing, such as request latency or the success rate.

Harbor brings system metrics, logs and the terminal into one Mac window. Connect to your Linux server over SSH, check System for the busy process, and switch to Logs to compare timestamps. Its Linux monitoring uses Python 3 on the server.

Why is load high when CPU usage looks low?

Load can include tasks waiting on disk or other uninterruptible work. Check CPU samples alongside I/O wait and storage metrics before attributing the slowdown to CPU.

References