UPGRD
← Home

Systems Engineering

Why Docker Storage Benchmarks Are Often Misleading

Containers share the host kernel, but their filesystem behavior can differ considerably from native applications. Understanding OverlayFS is essential to interpreting container storage benchmarks.

Home · · 6 min read · Updated November 26, 2026
  • Docker
  • OverlayFS
  • Containers
  • Storage
  • Linux
  • Benchmarking
Layered container filesystem showing read-only image layers, a writable upper layer and a mounted volume.

Quick summary

Containers share the host kernel, but their filesystem behavior can differ considerably from native applications. Understanding OverlayFS is essential to interpreting container storage benchmarks.

“It is just a process on the host” is a useful starting point for containers, but a poor conclusion about their I/O. A Linux container shares the host kernel, yet the path through its filesystem namespace may include an overlay mount, a container writable layer, a volume mount, or some combination. Those paths have different semantics and can produce different benchmark results—even before the application or benchmark tool is considered.

The first question is not whether Docker is slower. It is: which storage path did the test actually measure, on which kernel and backing filesystem, with what cache state and write pattern?

What OverlayFS changes

OverlayFS presents a merged directory tree from a read-only lower layer and a writable upper layer. In a typical image-backed container, image layers provide lower content and the container has an upper writable layer. Lookups see the upper copy when one exists; otherwise they can resolve to a lower file. This arrangement supports image sharing and a unified filesystem view, but it is not identical to a single ordinary directory tree in operational cost.

A key behavior is copy-up. If a file exists only in a lower layer and an operation requires write access, OverlayFS first copies the file into the upper layer, including its data for regular files, then writes to the upper copy. Editing one small part of a large lower-layer file may therefore trigger a much larger initial copy. Later writes to that upper copy have different costs. Creating a new file in the container’s upper layer does not involve copying up an existing lower file. Read operations on lower files do not necessarily copy them up.

This distinction can invert simplistic benchmark results. A test that repeatedly writes a newly created file measures something different from one that modifies an image file for the first time. A test that creates its data set before timing avoids measuring initial setup, but could also avoid the copy-up cost an application experiences on its first mutation. Whether that cost matters depends on the lifecycle: one-time startup, periodic updates, or repeated modification.

Writable layer is not a volume

Docker’s container writable layer is managed by a storage driver and is generally tied to the container’s lifetime. Docker volumes store data outside that writable layer and persist independently of a container. Bind mounts expose a host path; a volume is managed by Docker. These are not interchangeable benchmark labels: each has a different mount and management path, and application data commonly belongs in a volume or bind mount rather than in the container’s ephemeral writable layer.

Do not assume all Docker installations use the same implementation. Docker’s documentation describes the classic overlay2 storage driver separately from the newer OverlayFS snapshotter used with the containerd image store, and rootless configurations may use fuse-overlayfs. Kernel version, Docker version, image store, backing filesystem, mount options, and rootless mode all affect the path. Record docker info, the mount type, kernel, and backing filesystem with any reported result; never treat “Docker storage” as a single device or driver.

Why fio numbers can mislead

Benchmark configuration decides what a result means. Buffered I/O can be satisfied partly from the page cache, particularly in a warm run; a run larger than available cache can instead include device reads. Direct I/O changes interactions with the page cache, but has alignment and filesystem-specific considerations and is not automatically representative of an application’s normal access pattern. Synchronous writes, asynchronous queue depth, sequential throughput, and small random I/O exercise distinct costs.

Setup and teardown matter too. Creating files inside a timed interval includes metadata work and possibly allocation; pre-creating them excludes those costs. Reusing the same data can make a “cold” test warm unless cache state is controlled, while dropping the host page cache can perturb other workloads and is unsuitable as a casual production action. A sync at the end measures durability-related work that a buffered write-only test may defer. State the exact fio job, file size, block size, I/O engine, depth, direct/buffered setting, duration, synchronization behavior, and whether the run was cold or warm.

On Linux, first identify the storage path rather than guessing from the container label:

docker info --format '{{.Driver}}'
findmnt -T /path/to/application-data

For a short mixed-I/O example, run from a disposable directory on the mount under test:

fio --name=randrw --filename=./fio-scratch.bin --size=64m \
    --rw=randrw --rwmixread=70 --bs=4k --ioengine=sync \
    --fsync=1 --runtime=10 --time_based --group_reporting

This writes only the named scratch file; choose a fresh path and never point fio at production data. The job is an illustration, not a universal database profile.

Small-file operations and directory traversal can be sensitive to metadata and overlay lookup behavior, whereas large sequential I/O may be dominated by the backing device. A number from one pattern should not be generalized to “filesystem performance.” Compare latency distributions and operations per second as well as throughput, and repeat enough to reveal variability without disguising the first-write path.

Build a fair comparison

For a useful test matrix, compare a native host path, a container writable layer, a named volume, and a bind mount. Use the same backing device and equivalent filesystem conditions where possible; record when that is not possible. Keep the fio workload and data size constant. Run one series against fresh files and another against already-created files, so copy-up and setup costs are visible rather than accidentally mixed into a steady-state figure. For containerized applications, benchmark the mount path actually used for application data. A database query plan also changes the read pattern presented to storage; PostgreSQL’s index-versus-scan choice is one related layer.

Use disposable data and an isolated host. fio writes what its job file tells it to write; point it at a throwaway file or directory, not a production data path. Avoid interpreting container overlay storage as a substitute for testing a database volume, or vice versa. Check the kernel’s OverlayFS documentation for implementation details and Docker’s storage docs for version-specific driver behavior.

Desktop containers add another boundary

On macOS and Windows, Docker Desktop runs Linux containers inside a Linux virtual machine. A path shared from the desktop host crosses a VM and file-sharing boundary; it is not the same test as a Linux container reading from a local Linux filesystem. Docker Desktop’s file-sharing implementation and configuration can therefore dominate the observed behavior. Benchmarking a Linux host path from inside a Linux VM is not equivalent to benchmarking a host-shared project directory.

Container storage benchmarks become useful when they make the path, operation, and lifecycle explicit. Separate lower-layer reads from first-write copy-up, distinguish writable layers from volumes, control caching and synchronization, and report the actual driver and platform. Then the result says something actionable about your deployment, rather than offering a universal verdict on containers.

References

Linux kernel OverlayFS documentation; Docker OverlayFS storage driver documentation; Docker storage drivers overview; Docker volumes documentation; Docker Desktop virtual machine managers; Docker Desktop synchronized file sharing; fio documentation.