# איזה אחורי אחסון Docker הוא הטוב ביותר לשימוש ב-VPS?

**URL:** https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646
**Category:** Self-hosting
**Tags:** docker
**Created:** [18 באוקטובר,‏ 2015,‏ 7:57am UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646 "2015-10-18T07:57:37Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jd2066](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jd2066](https://meta.discourse.org/u/jd2066)
#### Post date: [18 באוקטובר,‏ 2015,‏ 7:57am UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/1 "2015-10-18T07:57:37Z")

</div>

From what I have found, these are the available storage drivers:

1. Union File Systems - aufs and overlayfs

2. Snapshot Enabled File System - btrfs

3. Device Mapper Loopback

4. Device Mapper using raw block devices

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [18 באוקטובר,‏ 2015,‏ 8:12pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/2 "2015-10-18T20:12:48Z")

</div>

aufs or overlay if you are feeling adventurous, avoid all others.

---

<div class="post-metadata">

### Author: ![jd2066](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jd2066](https://meta.discourse.org/u/jd2066)
#### Post date: [18 באוקטובר,‏ 2015,‏ 9:41pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/3 "2015-10-18T21:41:05Z")

</div>

> [@sam](#):
>
> aufs or overlay if you are feeling adventurous, avoid all others.

Ok. I had thought device-mapper might only be an issue with loopback images but it is ok to use with raw block devlices. It seems that is not the main issue with the device-mapper backend.  
At the moment I use overlay as think I would need to compile my own kernel to use aufs (Which I can do, just more convient to use the pre-compiled kernel).

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [18 באוקטובר,‏ 2015,‏ 9:42pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/4 "2015-10-18T21:42:33Z")

</div>

I have personally had lots of luck with overlay, perf is better than aufs. You got to watch out for inode counts though.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [18 באוקטובר,‏ 2015,‏ 11:11pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/5 "2015-10-18T23:11:03Z")

</div>

Never, ever use device mapper. That is a one way ticket to corruption town, sooner or later. It is buggy as hell and has been for a year despite Red Hat saying “it works now” over and over.

---

<div class="post-metadata">

### Author: ![jd2066](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jd2066](https://meta.discourse.org/u/jd2066)
#### Post date: [18 באוקטובר,‏ 2015,‏ 11:39pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/6 "2015-10-18T23:39:58Z")

</div>

> [@codinghorror](#):
>
> Never, ever use device mapper. That is a one way ticket to corruption town, sooner or later. It is buggy as hell and has been for a year despite Red Hat saying “it works now” over and over.

Interesting, in theory device-mapper seems like a good option.  
If in practice it just causes problems then I wonder why it’s still an available option in Docker and preferred over the overlayfs option if available.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [18 באוקטובר,‏ 2015,‏ 11:52pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/7 "2015-10-18T23:52:53Z")

</div>

I don’t know but you can ask the support customer whose corrupted install on Centos (and thus devicemapper) we just had to recover via a backup…

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 באוקטובר,‏ 2015,‏ 12:30am UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/8 "2015-10-19T00:30:08Z")

</div>

For some context see:

[https://github.com/docker/docker/pull/12354#issuecomment-121958324](https://github.com/docker/docker/pull/12354#issuecomment-121958324)

and

> @SamSaffron

> I think we have made lot of progress on improving devicemapper graph driver. Lot of issues are because of static binary and I think many of the issues are configuration issues. Based on configuraiton, one can easily switch between loop based thin pool, or thin pool on block devices or  
> usage of external lvm thin pool. If such switch happens, data in /var/lib/docker/devmapper/ is stale  
> and all sorts of errors will happen.

> To make things little better and detect configuation issues early, I have created following PR. This should help a bit I think.

> #13896

For our most recent corruption, I don’t know if the docker binary was statically or dynamically compiled, I do know it was using latest docker.

We have been burnt so many times by device mapper that my confidence is totally eroded.

---

<div class="post-metadata">

### Author: ![jd2066](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jd2066](https://meta.discourse.org/u/jd2066)
#### Post date: [19 באוקטובר,‏ 2015,‏ 4:19am UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/9 "2015-10-19T04:19:22Z")

</div>

> [@sam](#):
>
> For some context see:  
> [graphdriver: promote overlay driver to first by vbatts · Pull Request #12354 · moby/moby · GitHub](https://github.com/docker/docker/pull/12354)

That is helpful information.

> [@jd2066](#):
>
> If in practice it just causes problems then I wonder why it’s still an available option in Docker and preferred over the overlayfs option if available.

I know see there are two ways to interpret what I wrote.  
I was not questioning if you guys were correct, I was questioning why the docker developers would not either remove the device-mapper backend or at last move it to the bottom of the storage backends list.  
After looking at the link quoted above, it seems someone was trying to get the overlayfs backend higher up in the priority list.  
It appears looking at the link that overlayfs has some issues that still need to be fixed before it’s first though it seems it should at least be a higher prioity then the vfs backend as the vfs backend ends up using all available hard disk space very quickly.

---

<div class="post-metadata">

### Author: ![jd2066](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jd2066](https://meta.discourse.org/u/jd2066)
#### Post date: [29 בנובמבר,‏ 2016,‏ 2:24pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/10 "2016-11-29T14:24:50Z")

</div>

To answer the question I asked about a year ago, the best storage backend driver appears to be overlay2 which was added in docker 1.12 and according to the [docker page on overlay vs. overlay2](https://docs.docker.com/engine/userguide/storagedriver/selectadriver/#overlay-vs-overlay2), the “overlay2 driver addresses” the “known limitations with inode exhaustion and commit performance” of the “the overlay driver”.

It is however “only compatible with Linux kernel 4.0” but that isn’t a problem with my VPS as it uses a recent kernel (4.7 at the moment).

I didn’t really get around to working on my web site that much in the last year so the fact that it took about a year for this driver to come into existence didn’t end up being a problem.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8 ביוני,‏ 2024,‏ 12:45pm UTC](https://meta.discourse.org/t/what-is-the-best-docker-storage-backend-to-use-on-a-vps/34646/11 "2024-06-08T12:45:06Z")

</div>

This topic was automatically closed after 3156 days. New replies are no longer allowed.
