{
  "id": 21970718,
  "title": "A 500m CPU limit turned 2,000 req/s into 70 % errors – measured on k3s",
  "url": "https://urgent.news/2026/11/26/a-500m-cpu-limit-turned-2-000-req-s-into-70-errors-measured-on-k3s",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-26T12:06:03.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/thomaszachmann/a-500m-cpu-limit-turned-2000-reqs-into-70-errors-measured-on-k3s-1l42"
  },
  "original_language": "en",
  "account": "A small URL shortener deployed on a three-node k3s cluster experienced a significant degradation in performance when a CPU limit was introduced. The cluster consisted of one node with 4 vCPUs and two nodes with 2 vCPUs each. A Go service with two replicas and PostgreSQL via CloudNativePG was tested using k6 with a constant arrival rate of 2,000 requests per second for 20 seconds. The results showed that a CPU limit of 500m caused 69-75% of requests to fail, while a limit of 250m caused only 0% failures. This discrepancy was attributed to the CFS throttling mechanism in the Linux kernel, which limits each container to 50 ms of CPU time per 100 ms window. When the CPU limit was reached, the container was no longer scheduled, causing requests to queue up and eventually fail due to a 2-second timeout. To measure CPU throttling in your own cluster, you can use the kubelet to log CFS periods and throttled periods of containers named with a specific string. A Prometheus alert can be set up to monitor the ratio of throttled periods to total periods. It is recommended to set CPU limits based on measured bursts rather than averages, especially in multi-tenant clusters with guaranteed QoS. The exact numbers may vary depending on the specific cluster and service, but the underlying mechanism remains the same.",
  "summary": "I moved a small URL shortener from three VMs onto a three-node k3s cluster and measured it with k6 before and after every change. One change looked harmless and wasn't: a CPU limit. The setup k3s, three nodes (one with 4 vCPUs, two with 2 vCPUs) a Go service with two replicas, PostgreSQL via CloudNativePG k6 with a constant arrival rate : 2,000 requests per second for 20 seconds, 90 % redirects,…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}