McKube 0 requests sent

CPU Limits, Millicores, and Linux CFS Throttling Explained

Why tight CPU limits cause tail-latency spikes even when nodes look idle, and when omitting limits.cpu makes sense.

How Linux CFS quota throttling works in 100ms periods

A CPU limit of 200m translates to 20ms of CPU time per 100ms CFS period. If a multi-threaded Go, Java, or Node.js service spawns 4 worker threads that each burn 5ms in parallel during a single request, the container exhausts its entire 20ms quota in 5ms of wall-clock time and is frozen by the kernel for the remaining 95ms. Even if the host node has 12 completely idle CPU cores, your p99 latency spikes by 100ms.

Practical pattern for requests.cpu vs limits.cpu

Always set realistic requests.cpu so the scheduler bin-packs fairly and guarantees baseline CPU shares under contention. For latency-sensitive microservices on dedicated clusters, many platform teams set requests.memory == limits.memory while either omitting limits.cpu or setting generous burst headroom, monitoring container_cpu_cfs_throttled_periods_total in Prometheus.