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.



Join the 80/20 DevOps Newsletter

If you're an engineering leader or developer, you should subscribe to my 80/20 DevOps Newsletter. Give me 1 minute of your day, and I'll teach you essential DevOps skills. I cover topics like Kubernetes, AWS, Infrastructure as Code, and more.

Not sure yet? Check out the archive.

Unsubscribe at any time.