3

There is huge difference in how fast containers deleted between ubuntu and arch linux:

# ubuntu
$ time docker rm 2761334a4236
2761334a4236

real    0m0.025s
user    0m0.017s
sys 0m0.004s

# arch linux
$ time docker rm 190b9f1b195b
190b9f1b195b
docker rm 190b9f1b195b  0.08s user 0.01s system 6% cpu 1.356 total

I suspect that there is big difference on how docker utilize ubuntu and arch's filesystems but I didn't found clear explanation on how can make it faster on arch linux.

My questions are:

  • Is it possible to make docker to delete containers with same speed on arch linux that is on ubuntu?
  • How can I achieve that speed?

UPD.

  • Could be anything. Can you please post some additional data about the containers (size, ...) and the docker engine (storage driver, ...)? Also, the specs of the servers where this is being run would help. – dawud Jun 05 '16 at 10:53
  • Thank you for reviewing my question! I've attached system information to the question (for some reason `docker ps` says that container size is zero for both systems). – Leonid Shagabutdinov Jun 07 '16 at 02:13
  • I think the problem is with the `storage driver`, seems I should install aufs on arch and switch storage driver. – Leonid Shagabutdinov Jun 07 '16 at 02:25

1 Answers1

2

Finally I did it:

# arch linux
$ time docker rm 0b155dcf371c       
0b155dcf371c
docker rm 0b155dcf371c  0.01s user 0.01s system 87% cpu 0.030 total

The short answer is - I had to switch the storage engine to aufs.

The long answer is:

  1. Install aufs and linux-aufs_friendly packages from aur
  2. Generate new grub with sudo grub-mkconfig -o /boot/grub/grub.cfg
  3. Reboot to new kernel
  4. Activate new modules: modprobe loop, modprobe aufs
  5. Force docker to use aufs: ExecStart=/usr/bin/docker daemon --storage-driver=aufs -H fd:// in /usr/lib/systemd/system/docker.service
  6. Restart docker: sudo systemctl restart docker

Note that all images, containers and volumes will be removed from docker. Also custom kernel modules (such vbox) will stop working because there are two different versions of kernel. Proceed with care.