Burstable VMs provide a baseline level of CPU performance with the ability to temporarily “burst” to higher levels during periods of increased demand.
When running Docker containers on burstable VMs, using CPU shares is a better approach than setting hard CPU limits. The --cpu-shares option in Docker allows you to assign relative weights to containers, ensuring higher-priority containers receive more CPU time during contention.
Monitoring actual CPU credit usage and performance metrics is crucial when deploying containerized workloads on burstable VMs. Tools like CloudWatch or Stackdriver can help identify trends and address CPU credit depletion to prevent throttling.
It is important to understand the interplay between Docker's CPU sharing model and the cloud provider's burstable VM constraints to optimize efficiency. Using CPU shares combined with autoscaling policies and managing container startup behavior can lead to more efficient and resilient systems.