Speed Up CI Docker I/O Intensive Workloads with tmpfs

Volumes and bind mounts let you share files between the host machine and container so that you can persist data even after the container is stopped.

If you’re running Docker on Linux, you have a third option: tmpfs mounts. When you create a container with a tmpfs mount, the container can create files outside the container’s writable layer.

As opposed to volumes and bind mounts, a tmpfs mount is temporary, and only persisted in the host memory. When the container stops, the tmpfs mount is removed, and files written there won’t be persisted.

–via https://docs.docker.com/storage/tmpfs/

Docker supports tmpfs volume mounts. tmpfs mounts can be used for CI workloads that are disk I/O intensive to trade off additional memory for faster filesystem access by keeping the filesystem entirely within memory.

I’ve seen massive speed-ups in GitHub Actions test workflows at Venmo that were often accessing databases.

Resources

https://docs.docker.com/storage/tmpfs/


Master GitHub Actions with a Senior Infrastructure Engineer

As a senior staff infrastructure engineer, I share exclusive, behind-the-scenes insights that you won't find anywhere else. Get the strategies and techniques I've used to save companies $500k in CI costs and transform teams with GitOps best practices—delivered straight to your inbox.

Not sure yet? Check out the archive.

Unsubscribe at any time.