Skip to content

Commit 2c0b5e2

Browse files
authored
Merge pull request docker#7669 from thaJeztah/update_select_a_storage_driver
Update "select a storage driver" with current status
2 parents 26a01e4 + 3805b23 commit 2c0b5e2

File tree

1 file changed

+81
-73
lines changed

1 file changed

+81
-73
lines changed

storage/storagedriver/select-storage-driver.md

Lines changed: 81 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -21,48 +21,53 @@ After you have read the [storage driver overview](index.md), the
2121
next step is to choose the best storage driver for your workloads. In making
2222
this decision, there are three high-level factors to consider:
2323

24-
- If multiple storage drivers are supported in your kernel, Docker has a
25-
prioritized list of which storage driver to use if no storage driver is
26-
explicitly configured, assuming that the prerequisites for that storage driver
27-
are met:
28-
29-
- If possible, the storage driver with the least amount of configuration is
30-
used, such as `btrfs` or `zfs`. Each of these relies on the backing
31-
filesystem being configured correctly.
32-
33-
- Otherwise, try to use the storage driver with the best overall performance
34-
and stability in the most usual scenarios.
35-
36-
- `overlay2` is preferred, followed by `overlay`. Neither of these requires
37-
extra configuration. `overlay2` is the default choice for Docker CE.
38-
39-
- `devicemapper` is next, but requires `direct-lvm` for production
40-
environments, because `loopback-lvm`, while zero-configuration, has very
41-
poor performance.
42-
43-
The selection order is defined in Docker's source code. You can see the order
44-
by looking at
45-
[the source code for Docker CE {{ site.docker_ce_stable_version }}](https://github.com/docker/docker-ce/blob/{{ site.docker_ce_stable_version }}/components/engine/daemon/graphdriver/driver_linux.go#L50)
46-
You can use the branch selector at the top of the file viewer to choose a
47-
different branch, if you run a different version of Docker.
48-
{: id="storage-driver-order" }
49-
50-
- Your choice may be limited by your Docker edition, operating system, and
51-
distribution. For instance, `aufs` is only supported on Ubuntu and Debian, and
52-
may require extra packages to be installed,
53-
while `btrfs` is only supported on SLES, which is only supported with Docker
54-
EE. See
55-
[Support storage drivers per Linux distribution](#supported-storage-drivers-per-linux-distribution).
56-
57-
- Some storage drivers require you to use a specific format for the backing
58-
filesystem. If you have external requirements to use a specific backing
59-
filesystem, this may limit your choices. See
60-
[Supported backing filesystems](#supported-backing-filesystems).
61-
62-
- After you have narrowed down which storage drivers you can choose from, your
63-
choice are determined by the characteristics of your workload and the
64-
level of stability you need. See [Other considerations](#other-considerations)
65-
for help making the final decision.
24+
If multiple storage drivers are supported in your kernel, Docker has a prioritized
25+
list of which storage driver to use if no storage driver is explicitly configured,
26+
assuming that the storage driver meets the prerequisites.
27+
28+
Use the storage driver with the best overall performance and stability in the most
29+
usual scenarios.
30+
31+
Docker supports the following storage drivers:
32+
33+
* `overlay2` is the preferred storage driver, for all currently supported
34+
Linux distributions, and requires no extra configuration.
35+
* `aufs` is the preferred storage driver for Docker 18.06 and older, when
36+
running on Ubuntu 14.04 on kernel 3.13 which has no support for `overlay2`.
37+
* `devicemapper` is supported, but requires `direct-lvm` for production
38+
environments, because `loopback-lvm`, while zero-configuration, has very
39+
poor performance. `devicemapper` was the recommended storage driver for
40+
CentOS and RHEL, as their kernel version did not support `overlay2`. However,
41+
current versions of CentOS and RHEL now have support for `overlay2`,
42+
which is now the recommended driver.
43+
* The `btrfs` and `zfs` storage drivers are used if they are the backing
44+
filesystem (the filesystem of the host on which Docker is installed).
45+
These filesystems allow for advanced options, such as creating "snapshots",
46+
but require more maintenance and setup. Each of these relies on the backing
47+
filesystem being configured correctly.
48+
* The `vfs` storage driver is intended for testing purposes, and for situations
49+
where no copy-on-write filesystem can be used. Performance of this storage
50+
driver is poor, and is not generally recommended for production use.
51+
52+
Docker's source code defines the selection order. You can see the order at
53+
[the source code for Docker Engine - Community {{ site.docker_ce_stable_version }}](https://github.com/docker/docker-ce/blob/{{ site.docker_ce_stable_version }}/components/engine/daemon/graphdriver/driver_linux.go#L50)
54+
55+
If you run a different version of Docker, you can use the branch selector at the top of the file viewer to choose a different branch.
56+
{: id="storage-driver-order" }
57+
58+
Some storage drivers require you to use a specific format for the backing filesystem. If you have external
59+
requirements to use a specific backing filesystem, this may limit your choices. See [Supported backing filesystems](#supported-backing-filesystems).
60+
61+
After you have narrowed down which storage drivers you can choose from, your choice is determined by the
62+
characteristics of your workload and the level of stability you need. See [Other considerations](#other-considerations)
63+
for help in making the final decision.
64+
65+
> ***NOTE***: Your choice may be limited by your Docker edition, operating system, and distribution.
66+
> For instance, `aufs` is only supported on Ubuntu and Debian, and may require extra packages
67+
> to be installed, while `btrfs` is only supported on SLES, which is only supported with Docker
68+
> Enterprise. See [Support storage drivers per Linux distribution](#supported-storage-drivers-per-linux-distribution)
69+
> for more information.
70+
6671

6772
## Supported storage drivers per Linux distribution
6873

@@ -73,25 +78,34 @@ In addition, Docker does not recommend any configuration that requires you to
7378
disable security features of your operating system, such as the need to disable
7479
`selinux` if you use the `overlay` or `overlay2` driver on CentOS.
7580

76-
### Docker EE and CS-Engine
81+
### Docker Engine - Enterprise and Docker Enterprise
7782

78-
For Docker EE and CS-Engine, the definitive resource for which storage drivers
79-
are supported is the
83+
For Docker Engine - Enterprise and Docker Enterprise, the definitive resource for which
84+
storage drivers are supported is the
8085
[Product compatibility matrix](https://success.docker.com/Policies/Compatibility_Matrix).
8186
To get commercial support from Docker, you must use a supported configuration.
8287

83-
### Docker CE
88+
### Docker Engine - Community
8489

85-
For Docker CE, only some configurations are tested, and your operating system's
86-
kernel may not support every storage driver. In general, the following
90+
For Docker Engine - Community, only some configurations are tested, and your operating
91+
system's kernel may not support every storage driver. In general, the following
8792
configurations work on recent versions of the Linux distribution:
8893

89-
| Linux distribution | Recommended storage drivers |
90-
|:--------------------|:------------------------------------------------------------------------------------------------------|
91-
| Docker CE on Ubuntu | `aufs`, `devicemapper`, `overlay2` (Ubuntu 14.04.4 or later, 16.04 or later), `overlay`, `zfs`, `vfs` |
92-
| Docker CE on Debian | `aufs`, `devicemapper`, `overlay2` (Debian Stretch), `overlay`, `vfs` |
93-
| Docker CE on CentOS | `devicemapper`, `vfs` |
94-
| Docker CE on Fedora | `devicemapper`, `overlay2` (Fedora 26 or later, experimental), `overlay` (experimental), `vfs` |
94+
| Linux distribution | Recommended storage drivers | Alternative drivers |
95+
|:--------------------|:-----------------------------------------------------------------------|:--------------------------------------------------|
96+
| Docker Engine - Community on Ubuntu | `overlay2` or `aufs` (for Ubuntu 14.04 running on kernel 3.13) | `overlay`¹, `devicemapper`², `zfs`, `vfs` |
97+
| Docker Engine - Community on Debian | `overlay2` (Debian Stretch), `aufs` or `devicemapper` (older versions) | `overlay`¹, `vfs` |
98+
| Docker Engine - Community on CentOS | `overlay2` | `overlay`¹, `devicemapper`², `zfs`, `vfs` |
99+
| Docker Engine - Community on Fedora | `overlay2` | `overlay`¹, `devicemapper`², `zfs`, `vfs` |
100+
101+
¹) The `overlay` storage driver is deprecated in Docker Engine - Enterprise 18.09, and will be
102+
removed in a future release. It is recommended that users of the `overlay` storage driver
103+
migrate to `overlay2`.
104+
105+
²) The `devicemapper` storage driver is deprecated in Docker Engine 18.09, and will be
106+
removed in a future release. It is recommended that users of the `overlay` storage driver
107+
migrate to `overlay2`.
108+
95109

96110
When possible, `overlay2` is the recommended storage driver. When installing
97111
Docker for the first time, `overlay2` is used by default. Previously, `aufs` was
@@ -112,10 +126,10 @@ storage driver, be sure to read about
112126
[its performance and storage characteristics and limitations](vfs-driver.md).
113127

114128
> **Expectations for non-recommended storage drivers**: Commercial support is
115-
> not available for Docker CE, and you can technically use any storage driver
129+
> not available for Docker Engine - Community, and you can technically use any storage driver
116130
> that is available for your platform. For instance, you can use `btrfs` with
117-
> Docker CE, even though it is not recommended on any platform for Docker CE,
118-
> and you do so at your own risk.
131+
> Docker Engine - Community, even though it is not recommended on any platform for
132+
> Docker Engine - Community, and you do so at your own risk.
119133
>
120134
> The recommendations in the table above are based on automated regression
121135
> testing and the configurations that are known to work for a large number of
@@ -140,12 +154,12 @@ backing filesystems.
140154

141155
| Storage driver | Supported backing filesystems |
142156
|:----------------------|:------------------------------|
143-
| `overlay`, `overlay2` | `ext4`, `xfs` |
144-
| `aufs` | `ext4`, `xfs` |
157+
| `overlay2`, `overlay` | `xfs` with fstype=1, `ext4` |
158+
| `aufs` | `xfs`, `ext4` |
145159
| `devicemapper` | `direct-lvm` |
146160
| `btrfs` | `btrfs` |
147161
| `zfs` | `zfs` |
148-
162+
| `vfs` | any filesystem |
149163

150164
## Other considerations
151165

@@ -155,13 +169,14 @@ Among other things, each storage driver has its own performance characteristics
155169
that make it more or less suitable for different workloads. Consider the
156170
following generalizations:
157171

158-
- `aufs`, `overlay`, and `overlay2` all operate at the file level rather than
172+
- `overlay2`, `aufs`, and `overlay` all operate at the file level rather than
159173
the block level. This uses memory more efficiently, but the container's
160174
writable layer may grow quite large in write-heavy workloads.
161175
- Block-level storage drivers such as `devicemapper`, `btrfs`, and `zfs` perform
162176
better for write-heavy workloads (though not as well as Docker volumes).
163177
- For lots of small writes or containers with many layers or deep filesystems,
164-
`overlay` may perform better than `overlay2`.
178+
`overlay` may perform better than `overlay2`, but consumes more inodes, which
179+
can lead to inode exhaustion.
165180
- `btrfs` and `zfs` require a lot of memory.
166181
- `zfs` is a good choice for high-density workloads such as PaaS.
167182

@@ -186,15 +201,8 @@ specific shared storage system.
186201

187202
For some users, stability is more important than performance. Though Docker
188203
considers all of the storage drivers mentioned here to be stable, some are newer
189-
and are still under active development. In general, `aufs`, `overlay`, and
190-
`devicemapper` are the choices with the highest stability.
191-
192-
### Experience and expertise
193-
194-
Choose a storage driver that your organization is comfortable maintaining. For
195-
example, if you use RHEL or one of its downstream forks, you may already have
196-
experience with LVM and Device Mapper. If so, the `devicemapper` driver might
197-
be the best choice.
204+
and are still under active development. In general, `overlay2`, `aufs`, `overlay`,
205+
and `devicemapper` are the choices with the highest stability.
198206

199207
### Test with your own workloads
200208

@@ -216,8 +224,8 @@ $ docker info
216224

217225
Containers: 0
218226
Images: 0
219-
Storage Driver: overlay
220-
Backing Filesystem: extfs
227+
Storage Driver: overlay2
228+
Backing Filesystem: xfs
221229
<output truncated>
222230
```
223231

0 commit comments

Comments
 (0)