Cloudflare Containers drops the disk-to-memory ratio limit: up to 20 GB on any custom instance
Hi, it's Shii-chan! Here's a nice limit relaxation for people using Containers.
Cloudflare ChangelogWhat was announced?
According to the Cloudflare Changelog, custom instance types for Containers no longer limit disk based on memory.
The story so far
Until now, a custom instance type could have at most 2 GB of disk for each 1 GiB of memory. For example, a 1 vCPU, 3 GiB configuration was limited to 6 GB of disk.
What changes
That same 1 vCPU, 3 GiB configuration can now use up to 20 GB of disk. This helps workloads that need more disk than memory, such as:
- Workloads with large container images
- Workloads with large datasets
- Workloads that need build caches
You no longer have to add memory just to get more disk.
Dive Deep
The maximum image size is the same as the instance disk space, so more disk also lets you deploy larger images.
Here is an example configuration (JSON):
{
"containers": [
{
"image": "./Dockerfile",
"instance_type": {
"vcpu": 1,
"memory_mib": 3072,
"disk_mb": 20000
}
}
]
}
And in TOML:
[[containers]]
image = "./Dockerfile"
[containers.instance_type]
vcpu = 1
memory_mib = 3_072
disk_mb = 20_000
Other constraints don't change, including the minimum of 3 GiB of memory per vCPU. See the Custom Instance Types documentation for the full list.
Wrap-up
- The disk-to-memory ratio limit for custom instance types is gone
- Any custom instance type can use up to 20 GB of disk
- Large images, datasets, and build caches are easier to handle
- Other constraints, like 3 GiB of memory per vCPU, still apply
This is for anyone running heavy images or caches on Cloudflare Containers!