Operations 12 min read

Understanding CPU Cores, Load Average, and How to Diagnose High CPU Usage on Linux

This article explains CPU fundamentals, the difference between physical and logical cores, how to query CPU details on Linux, the meaning of CPU utilization and load average, and provides practical steps for diagnosing high user‑mode CPU usage, especially in Java applications.

Efficient Ops
Efficient Ops
Efficient Ops
Understanding CPU Cores, Load Average, and How to Diagnose High CPU Usage on Linux

CPU (Central Processing Unit) is the core of a computer system, acting as the "brain" that executes programs and processes information.

When a CPU is overloaded, efficiency drops and the system may crash, so understanding CPU operation and controlling load are essential for stable operation.

Physical and Logical CPU Cores

A machine may have multiple CPU chips communicating via the system bus. Hyper‑Threading allows one physical core to handle two threads, appearing as two logical cores, but it does not double performance.

Example analogy: a class with two students (physical cores) assigned two roles; adding more roles forces the same students to multitask, creating four logical cores without four people.

How to Query CPU Information on Linux

CPU details can be read from

/proc/cpuinfo

:

<code>cat /proc/cpuinfo | grep 'physical id' | sort | uniq | wc -l</code>
<code>cat /proc/cpuinfo | grep 'cpu cores' | sort | uniq</code>
<code>cat /proc/cpuinfo | grep 'siblings' | sort | uniq</code>

What Is CPU Utilization?

CPU utilization is the proportion of time the CPU spends in non‑idle states, reflecting its busy level. For example, a single‑core CPU running 0.8 s of work in 1 s has 80 % utilization.

In Linux,

top

shows fields such as us (user), sy (system), ni (nice), id (idle), wa (iowait), hi (hardirq), si (softirq), st (steal). The overall utilization can be calculated as (1‑idle) × 100 %.

Best practice: keep total CPU utilization below 70 % in production.

What Is Load Average?

Load average is the average number of processes in runnable or uninterruptible states over a time interval, typically shown as three numbers for the past 1, 5, and 15 minutes.

Ideal load equals the number of logical CPU cores; a practical rule of thumb is to keep load below 0.7 × CPU‑core‑count.

Load > 0.7 × cores: investigate the cause.

Load > 1.0 × cores: take corrective action.

Load > 5.0 × cores: severe problem, possible system hang.

Monitoring load trends (short‑term vs. historical) helps assess stability.

Relationship Between CPU Utilization and Load Average

CPU utilization measures how busy the CPU is, while load average also counts processes waiting for CPU or I/O. In CPU‑intensive workloads the two metrics correlate; in I/O‑intensive workloads load can be high while utilization remains low.

Practical Performance Optimization

Both metrics are health indicators, useful for alerting and narrowing down problem domains. For example, high iowait points to disk I/O issues, while high steal suggests problems on the host in virtualized environments.

How to Diagnose High User‑Mode CPU Usage (Java Example)

Steps:

Use

top

to find the PID consuming most CPU.

Run

top -Hp &lt;PID&gt;

to locate the thread ID.

Convert the thread ID to hexadecimal:

printf "%x\n" &lt;tid&gt;

.

Run

jstack &lt;PID&gt; | grep &lt;hex‑tid&gt; -A 10

to see the Java stack trace.

For non‑Java processes, replace

jstack

with

perf

.

Note that this method may require multiple iterations and cannot diagnose offline issues.

performance-monitoringLinuxTroubleshootingCPUload average
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.