Get the latest tech news
Building Burstables: CPU slicing with cgroups
Burstable VMs run on a fraction of CPU and burst to a higher level of CPU usage to support occasional usage spikes. To implement them, we leveraged Control Groups v2 (cgroups v2), a Linux kernel feature that helps manage resource usage. We thought our open-source implementation of burstable VMs might be interesting enough to write about. We also learned a lot about Linux cgroups in the process!
This reveals real-time metrics on CPU usage, throttling events, and burst utilization - showing exactly how our constraints are being enforced on the workload. We made the cgroup setup logic run in parallel to other tasks performed during the provisioning of a VM and kept the overall elapsed time unchanged. For example, a simple fault-tolerant web app requires at least two VMs behind a load balancer, backed by a managed Postgres database.
Or read this on Hacker News