CPU
In plain English
Plain definition
Picture a cook working through a stack of recipe cards. The cook reads a step, does it and picks up the next card. A bigger kitchen has several cooks side by side, and a good cook can keep two dishes going at once. Every app you open is another pile of cards waiting its turn. At work you meet the word on laptop spec sheets, in top when a server feels slow, and in cloud instance sizes, which are quoted in vCPUs.
A CPU (central processing unit), or processor, is the chip that runs software. It works in a repeating cycle: fetch the next instruction from memory, decode it, execute it, then store the result in a register or back in memory. Modern CPUs hold several cores, and a core can run more than one thread, so Linux counts each schedulable thread as a CPU. That is why an AWS m5.xlarge, two cores with two threads each by default, shows up as four vCPUs.
How it works in technical terms
Arm describes the CPU as the core engine of a computing system: it performs calculations, executes instructions and manages data flow between memory, storage and peripherals. Inside it, a control unit interprets each instruction, an arithmetic logic unit does the maths, registers hold working values and caches keep frequently used data close to the core. A clock signal keeps all of this in step. Modern CPUs vary their clock speed with the workload, but Arm notes that a higher clock does not always mean better performance.
Where you meet it day to day
The second line of top splits CPU time into states, including us (user processes), sy (kernel), id (idle), wa (waiting for I/O) and st, time stolen from a virtual machine by the hypervisor. Press 1 for one line per CPU. A multi-threaded process can show more than 100% in the %CPU column, because it is using several CPUs at once.
How it fits with cores, threads and vCPUs
A core is a physical execution unit; a thread is a logical stream of instructions, and a core can run one or more. On Amazon EC2, each thread is presented to the instance as a vCPU. lscpu reports the number of CPUs, threads, cores, sockets and NUMA nodes, reading from sysfs and /proc/cpuinfo. Virtual machines also lean on the CPU: most modern processors include hardware virtualization support, and Microsoft’s WSL troubleshooting page traces WSL 2 error 0x80370102 to virtualization being disabled in the BIOS, usually under the CPU options.
Example: counting the CPUs on a Linux server
These commands only read:
nproc
nproc --all
lscpu
cat /sys/devices/system/cpu/online
nproc prints the processing units available to the current process, which can be fewer than the online processors; nproc --all prints the installed processors, ignoring CPU quotas. The online file lists the CPUs that are online and being scheduled. In the kernel documentation’s example it reads 0-1,3, with CPU 2 taken offline.
CPU counts are often confused with chips
A “CPU” in Linux output is a logical CPU, not a chip: with simultaneous multithreading each core shows up as more than one, so a count of 8 does not mean eight processors. Inside a virtual machine, lscpu describes the guest’s configuration rather than the physical host, and its manual warns that cores per socket can be wrong on virtual hardware. Load average is not pure CPU use either: /proc/loadavg counts tasks that are runnable and tasks waiting for disk I/O.
Related terms
- Core: a physical execution unit inside the CPU.
- Thread: a stream of instructions a core runs.
- vCPU: on EC2, one thread of a CPU core as the instance sees it.
- Load average: runnable and I/O-waiting tasks over 1, 5 and 15 minutes.
Further reading
Arm’s CPU glossary entry, the lscpu(1) and nproc(1) manual pages, the kernel’s guide to CPU topology in sysfs and AWS’s “CPU options for Amazon EC2 instances”.
Checking CPU capacity before you resize a server
Before adding CPUs, compare nproc with nproc --all to see whether your processes are limited to fewer CPUs than the machine has, and watch st in top: a high figure means the hypervisor is giving this guest’s time to something else, a matter for whoever runs the host. These checks change nothing, so there is nothing to roll back. On EC2 the instance type sets the default vCPUs; disk is sized separately, as in increasing an EBS volume and extending the Linux file system.
Authoritative Sources
What is a central processing unit? – Arm
What is a CPU? - Central Processing Unit Explained - AWS
lscpu(1) - Linux manual page
nproc(1) - Linux manual page
proc_cpuinfo(5) - Linux manual page
top(1) - Linux manual page
proc_loadavg(5) - Linux manual page
How CPU topology info is exported via sysfs
CPU options for Amazon EC2 instances
Troubleshooting Windows Subsystem for Linux
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Recommended reading
More from KBY that goes with this term.
Stack guideBest budget laptops for staff: the spec to standardise on and the models to buy
3 min read
- Microsoft Intune error
0x800705b4: Autopilot self-deploying mode fails at Securing your hardware
2 min read
Education ITClassroom management software for schools: check what your devices already include
9 min read
