2

It seems that when using overlay2 storage driver, docker is much slower when using a LVM compared to without a LVM (ext4 filesystem in both cases, same machine).

Questions:

  1. Is this intended/expected?
  2. Is a LVM a recommended setup for docker usage?
  3. Is it worth to try other storage drivers (e.g. devicemapper with direct-lvm)?

2 Answers 2

0

I'm not an docker expert, just responding from my experience and limited knowledge.

  1. It's expected, yes.
  2. That's a matter of opinion. I'd say no, but that's very subjective.
  3. Yes.

https://docs.docker.com/storage/storagedriver/device-mapper-driver/

0

1. Is this intended/expected?

Yes, it can be expected. The overlay2 storage driver operates at the file level, and when combined with LVM, there can be additional overhead due to the abstraction layer that it introduces. Thus, slower performance compared to using a direct ext4 filesystem.

2. Is a LVM a recommended setup for Docker usage?

LVM is not typically recommended for Docker’s overlay2 storage driver due to the potential performance overhead. Docker’s documentation suggests using overlay2 with a direct filesystem like ext4 or xfs for better performance. LVM can be useful for other purposes, such as managing disk space more flexibly, but it might not be ideal for Docker’s storage needs.

3. Is it worth trying other storage drivers (e.g., devicemapper with direct-lvm)?

Worth experimenting. The devicemapper driver, especially with direct-lvm, can offer better performance for certain workloads, particularly those that are write-intensive. However, it’s important to note that devicemapper operates at the block level, which can be more complex to set up and manage compared to overlay2.

EDIT

These are some simple benchmarks intended to discover performance differences between Docker storage drivers (aufs, overlay, overlay2, and devicemapper).

This repository shows a docker storage benchmark (dated from 2017) : https://github.com/chriskuehl/docker-storage-benchmark

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.