A virtual machine bandwidth rate limiter is a host-level component in a cloud environment that governs the network throughput each VM can consume. Instead of counting discrete API calls per second, this system shapes continuous flows of bytes at the hypervisor layer. Each VM receives at least its promised base bandwidth, the total never surpasses the physical NIC capacity, and unused bandwidth is automatically reallocated to VMs with higher demand. The system acts as a bandwidth scheduler, not a request counter.
[!NOTE] This is not about classic API rate limiting. There are no distributed counters, no sliding time windows, no HTTP 429 responses. The challenge is live traffic shaping over a shared physical link. Every packet-scheduling decision must execute in microseconds, and the fairness guarantee it maintains is host-wide, adapting whenever any VM's traffic demand changes. If your first thought is “assign a token bucket per VM and drop excess,” keep reading to see why that wastes half the host’s capacity.
The core problem is fairly dividing one host’s NIC capacity among many VMs without wasting idle bandwidth or allowing a single noisy VM to degrade others.
10 Gbps) across all VMs.100 Mbps) that remains honored even when all VMs are contending.Out of scope (below the line)
| Parameter | Value | Design consequence |
|---|---|---|
| Host NIC capacity | 10 Gbps | Global ceiling for the scheduler |
| VMs per host | ~50 | Number of bandwidth classes in the hierarchy |
| Per-VM guaranteed minimum | 100 Mbps | Floor that must hold under contention |
| Total guaranteed bandwidth | 5 Gbps (50 x 100 Mbps) | 50% of NIC committed to guarantees |
| Surplus available for borrowing | 5 Gbps | Remaining capacity for work-conserving redistribution |
| Packet rate at line rate (1500 B MTU) | ~830k pkt/s | Throughput the scheduler must sustain |
| Per-packet decision budget | ~1.2 us | Forces the scheduler into the kernel hot path |
| Policy update frequency | ~1-10/min fleet-wide | Control plane is low-volume CRUD |
| Metrics sampling interval | 1-10 s per VM | Metrics can be batched, not per-packet |
The numbers that most shape the design are the per-packet decision budget (~1.2 us) and the 50/50 split between guaranteed and surplus bandwidth. The microsecond budget means the scheduler cannot make remote calls or take locks on the packet hot path. The 50% surplus means work-conserving redistribution is not an edge case—it is half the system’s value.