CPU Scheduling
Goals (throughput, latency, fairness), FIFO, shortest job first and round robin, multi-level feedback queues, Linux CFS and EEVDF, priorities and nice values, real-time scheduling, multicore scheduling and affinity, and what containers' CPU limits mean (CFS quota throttling).
Policies and what they optimise
nice -n 10 ./batch-job # lower priority (higher nice) for background work chrt -f 50 ./latency-critical # real-time FIFO priority (Linux; use with great care) taskset -c 2,3 ./service # pin to CPUs 2 and 3 (affinity)
CPU limits in containers
Kubernetes CPU limits are enforced with CFS bandwidth control: a container with a limit of 1 CPU gets 100 ms of CPU time per 100 ms period. A multi-threaded runtime using 4 threads can burn the quota in 25 ms and then be throttled for 75 ms, adding latency spikes even though average CPU looks fine. Watch container_cpu_cfs_throttled_periods_total; many teams set requests but no CPU limits for latency-sensitive services, and size runtime thread counts (GOMAXPROCS, JVM active processor count, UV_THREADPOOL_SIZE) to the quota.