<h4>1. Is this intended/expected?</h4>
<p>Yes, it can be expected. The overlay2 storage driver operates at the <strong>file level</strong>, and when combined with LVM, there can be additional <strong>overhead</strong> due to the <strong>abstraction layer</strong> that it introduces. Thus, slower performance compared to using a direct ext4 filesystem.</p>
<h4>2. Is a LVM a recommended setup for Docker usage?</h4>
<p>LVM is <strong>not typically recommended</strong> for Docker’s <strong>overlay2</strong> storage driver due to the potential performance overhead. Docker’s <strong>documentation</strong> suggests using <strong>overlay2 with a direct filesystem like ext4 or xfs</strong> for better performance. LVM can be useful for other purposes, such as <strong>managing disk space more flexibly</strong>, but it might not be ideal for Docker’s storage needs.</p>
<h4>3. Is it worth trying other storage drivers (e.g., devicemapper with direct-lvm)?</h4>
<p>Worth experimenting. The <strong>devicemapper</strong> driver, especially with direct-lvm, can offer better performance for certain <strong>workloads</strong>, particularly those that are <strong>write-intensive</strong>. However, it’s important to note that devicemapper operates at the <strong>block level</strong>, which can be more <strong>complex to set up and manage</strong> compared to overlay2.</p>
<h3>EDIT</h3>
<blockquote>
<p>These are some simple benchmarks intended to discover performance differences between Docker storage drivers (aufs, overlay, overlay2, and devicemapper).</p>
</blockquote>
<p>This repository shows a docker storage benchmark (dated from 2017) :
<a href="https://github.com/chriskuehl/docker-storage-benchmark" rel="nofollow noreferrer">https://github.com/chriskuehl/docker-storage-benchmark</a></p>

CC BY-SA 4.0
2024-08-20T22:10:33.190Z
2024-08-20T22:16:00.393Z
2024-08-20T22:16:00.393Z
YassineLbk
<p>I'm not an docker expert, just responding from my experience and limited knowledge.</p>
<ol>
<li>It's expected, yes.</li>
<li>That's a matter of opinion. I'd say no, but that's very subjective.</li>
<li>Yes.</li>
</ol>
<p><a href="https://docs.docker.com/storage/storagedriver/device-mapper-driver/" rel="nofollow noreferrer">https://docs.docker.com/storage/storagedriver/device-mapper-driver/</a></p>

CC BY-SA 4.0
2022-08-01T16:21:41.447Z
2022-08-01T16:21:41.447Z
foo
<p>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).</p>
<p><strong>Questions:</strong></p>
<ol>
<li>Is this intended/expected?</li>
<li>Is a LVM a recommended setup for docker usage?</li>
<li>Is it worth to try other storage drivers (e.g. devicemapper with direct-lvm)?</li>
</ol>

<docker><linux><performance>
Docker performance when running on LVM
MRalwasser
# Docker performance when running on LVM

(Asked by: username_0 on 2022-03-07)

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)?

**Tags:** docker, linux, performance


---

## 2 answers

### Answer by username_1 on 2024-08-20. Score: 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>


---

### Answer by username_2 on 2022-08-01. Score: 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/>


---

