Runnable work, priorities and CPU quotas
easy 7 minA scheduler chooses among runnable threads on the CPUs they may use.
Video lesson · Chapter 1 of 4
The idle host with a throttled worker
Theory
Read or listen first. About 2 min.
What it is
A scheduler chooses among runnable threads on the CPUs they may use. A sleeping thread cannot consume a free core. Affinity narrows the eligible CPUs, relative weights share contended CPU time, and a bandwidth quota can suspend an entire group after its allowance is spent. Each constraint produces a different reason for waiting.
Why it exists
A service consumes its group budget early in each period, then waits until replenishment. Node-wide idle time hides this local shortage. Compare two deltas in cpu.stat at the workload boundary and examine runnable work during the same window. A high throttled-period fraction measures frequency, not the fraction of requests delayed.
If throttling stays flat during the stall, inspect effective CPU affinity, per-core demand and off-CPU waits.
The idle host with a throttled worker
Inside this chapter
- The Completely Fair Scheduler (CFS)
- Classic CFS accounts weighted execution time as virtual runtime and tracks runnable entities. Check the running kernel when interpreting observations because newer fair scheduling uses EEVDF.
- Preemption and Time Slices
- Preemption lets the kernel interrupt current work so another task runs. Shorter scheduling intervals can improve responsiveness while increasing switching and cache disruption.
- Nice values and Priorities
- A nice value changes a fair-class task’s relative CPU weight under contention. It does not reserve a fixed percentage or override an enclosing bandwidth quota.
- CPU Affinity and Pinning processes
- Affinity restricts eligible CPUs. It can improve locality or accidentally confine a busy pool to one core. Inspect effective affinity alongside per-core utilization.
- Cgroups CPU throttling
- A group can consume its period’s runtime early and wait for replenishment. Use deltas of throttled time and periods together with latency and runnable demand.
- Real-time Scheduling: SCHED_FIFO and SCHED_RR
- FIFO real-time tasks can continue until blocking, yielding or preemption by higher priority. Round robin also time-slices peers. Unbounded real-time work can starve ordinary services.
- The EEVDF Scheduler (Linux 6.6+)
- EEVDF tracks lag to select eligible entities and chooses an early virtual deadline among them. It entered Linux’s fair scheduler during the 6.6 transition.
How it works
Step through the idea, or press Play.
Assign a budget. A group receives 50 ms of CPU runtime per 100 ms period in this example.
Understand it
Worked incident
The idle host with a throttled worker
| Observation | Throttled periods per 100 (periods) | Interpretation |
|---|---|---|
| Baseline | 1 | A small fraction of quota periods ends in throttling. |
| Incident | 68 | More parallel workers burn through the same budget earlier. |
| After intervention | 4 | Align concurrency and quota with the target. Check throttling alongside throughput and tail latency. |
Choose the next investigation
Summary
The whole topic in one minute.
A group can reach its own bandwidth ceiling while another group or core has capacity. Aggregate utilization averages over that boundary.
If throttling stays flat during the stall, inspect effective CPU affinity, per-core demand and off-CPU waits.