A microVM that can push unlimited bytes through its network interface or its disk can make every other VM on the host slow. Firecracker's answer is a rate limiter on each emulated device, built from token buckets. The configuration is a handful of integers, and it is easy to set them to something that does not mean what you think. This post works through what each field does, using Firecracker's design document, its API specification and the network interface update guide, as of November 2026.

This is about Firecracker. It does not describe how any specific platform, Sandscale included, sets its limits.

Where the limiter sits

Firecracker's VMM thread emulates the VirtIO network and block devices. When the guest sends a packet, the Firecracker I/O thread copies it from the emulated interface to the host TAP device, and the design document says that is where rate limiting is applied. The same goes for block I/O to the backing file. Because it is applied in the VMM, a guest cannot turn it off from inside; it is the host operator's setting.

Rate limiters exist for:

  • Network interfaces, separately for receive (rx_rate_limiter) and transmit (tx_rate_limiter).
  • Block devices (rate_limiter on a drive).
  • The entropy device (rate_limiter on /entropy), which feeds random bytes to the guest's virtio-rng driver.
  • The serial console, which the production host guide recommends rate limiting if you enable it at all.

For vhost-user devices, the design doc says rate limiting is the backend's job, not Firecracker's.

Two buckets per limiter

Each limiter has up to two independent token buckets:

  • bandwidth, where a token is a byte.
  • ops, where a token is an operation, such as a packet or a disk request.

The API spec calls these independent bytes-per-second and operations-per-second limits, and both apply when both are set. A disk doing many tiny writes runs out of ops first; one doing large sequential reads runs out of bandwidth first. Configure both if you care about both kinds of noisy neighbour.

Three numbers per bucket

From the API spec:

  • size: the most tokens the bucket can hold.
  • refill_time: how many milliseconds it takes to refill the bucket from empty to size. The refill rate is derived from these two: size / refill_time tokens per millisecond.
  • one_time_burst (optional): an extra initial budget. The spec says refilling starts only after the initial burst is used.

Once a bucket is empty, the device can go only as fast as the refill rate. While it has tokens, consumption is not limited in speed, only in amount. So size is both "how big a burst after a quiet period" and, with refill_time, "what sustained rate".

Reading a config

Here is the example from Firecracker's network update guide:

"tx_rate_limiter": { "bandwidth": { "size": 1024, "one_time_burst": 1048576, "refill_time": 1000 } } 

Read it as:

  • Sustained rate: 1024 bytes per 1000 ms, which is 1 KiB a second. That is very low, fine for a documentation example and not for a real workload.
  • Burst after the bucket fills: at most 1024 bytes.
  • One-off budget at the start: 1 MiB, used first, before refilling begins.

And a more realistic shape for a sandbox that should be able to fetch a package but not saturate a link:

"rx_rate_limiter": { "bandwidth": { "size": 10485760, "refill_time": 1000 }, "ops": { "size": 2000, "refill_time": 1000 } } 

That is 10 MiB of tokens refilled over 1000 ms, so a sustained 10 MiB a second with bursts up to 10 MiB, and 2000 packets a second. Pick your own numbers from your host's capacity and how many VMs share it; these are here to show the arithmetic, not as a recommendation.

Common mistakes

Treating size as a rate. size is a capacity. The rate is size divided by refill_time. Doubling refill_time halves the rate without changing the burst.

Forgetting refill_time is milliseconds. A refill_time of 1 makes the refill rate size tokens per millisecond, which is a thousand times what you probably meant.

Setting only bandwidth on a disk. Small random writes can still generate enough operations to hurt other guests. The production host guide lists rate limiting alongside the jailer's resource limits as the tools for noisy-neighbour storage contention.

Assuming the limiter covers everything on the interface. Frames the guest sends to Firecracker's metadata service (MMDS) are answered inside Firecracker and never reach the TAP device, so the MMDS design doc says they are not charged to the TX limiter. It recommends a cgroup CPU quota to bound the CPU spent answering them. See the MMDS post for more.

Changing limits on a running VM

Network limiters can be changed after boot with PATCH /network-interfaces/{id}, and block drives can be patched with PATCH /drives/{id}. The update is merged with the existing settings: patching rx_rate_limiter leaves tx_rate_limiter alone. To remove a limit, set a bucket with size 0 and refill_time 0.

That makes dynamic policies possible. A host agent can give a VM a generous limit while it installs dependencies, then tighten it while untrusted code runs, without restarting anything.

What rate limiting is not

Rate limiting controls how much and how fast. It does not control where. A guest limited to a trickle can still send that trickle to any address the host routes. Firecracker's design doc says it does no network traffic filtering at all and that guest egress should be filtered at the host. Destination control is a firewall or proxy's job; see designing an egress allowlist.

It is also not a CPU or memory limit. Those come from cgroups, which the jailer sets up, and from the VM's configured vCPUs and memory. Resource exhaustion in agent sandboxes covers the guest-side view of those limits.

Where Sandscale fits

Sandscale sandboxes are Firecracker microVMs, and on Sandscale you do not set token buckets yourself. What you choose is the network mode, none by default or allowlist where your plan includes it, the size of the box within your plan's limits, and its time limit. The plans reference and pricing page list what each plan allows.

Originally published on the Sandscale blog.