6

I am trying to benchmark the overall system performance of running Docker using the Phoronix Test Suite 6.4.0 Milestone 2 running inside a fedora:23 image based container.

One thing that must be considered is, that Docker uses a proprietary UnionFS to store data. However, when running a real-world application (like Apache) inside Docker, the persistent data are usually stored on a dedicated folder on the host, running on a standard Linux filesystem like ext4, or in my case btrfs.

The solution I propose is to use the "docker volume" to mount a host directory into docker. The thing is I don't know which directories are to be used in the benchmarks and have to be mounted inside the Docker container.

The test Suite pts/disk for example should definitely use docker volumes instead of UnionFS. It contains these tests.

pts/compress-gzip
pts/sqlite
pts/apache
pts/pgbench
pts/compilebench
pts/iozone
pts/dbench
pts/fs-mark
pts/fio
pts/tiobench
pts/postmark
pts/aio-stress
pts/unpack-linux

Which directories in the Docker container should be mounted from host (made docker volumes)? Is it even a good idea to use the docker volumes? Are there any other caveats to consider when benchmarking Docker?

Slazer
  • 4,750
  • 7
  • 33
  • 60

1 Answers1

0

As mentioned in "Mount a shared-storage volume as a data volume"

In addition to mounting a host directory in your container, some Docker volume plugins allow you to provision and mount shared storage, such as iSCSI, NFS, or FC.

Since docker 1.9, this is done with docker volume create (and then you mount those volumes in their expected paths in the container)

That allows you to:

Which directories in the Docker container should be mounted from host

Any folder which include persistent data, and/or has an high volume of IO operations.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Just to note, the answer to the question "why use a data volume plugin like flicker" instead of just "Docker data volume" is "Unlike a Docker data volume which is tied to a single server, a Flocker data volume, called a dataset, is portable and can be used with any container in your cluster." Afaik if I sacrifice portability, Docker data volume is functionally equivalend, and probably even faster than any Docker volume plugin, right? – Slazer May 12 '16 at 21:52
  • @Slazer I agree. I just prefer using docker volume create since docker 1.9 as, plugin or not, it keeps volumes more visible, instead of being hidden being a container which exists just to be started (never run) and mounted by other containers. – VonC May 12 '16 at 21:53
  • Could you please advise me, looking at the tests I am going to run (generally disk I/O intensive tasks using real-world applications), which folders are the best candidates to being mounted from host (as a docker volume or docker volume plugin)? I have not programmed the test, so I do not see any easy way to guess which folders are in use. The tests are being run as root inside a Docker container. – Slazer May 12 '16 at 21:57
  • @Slazer It really depends on the application being run. Hence my last general-worded sentence in my answer. Try running your test without volume first, to establish a baseline, then introduce volumes. – VonC May 12 '16 at 21:59
  • I guess the best way to know is to confine them one by one inside the home directory (by SELinux perhaps) and see what happens. I suspect them trying to use something like `/tmp` and maybe `/var` or `/usr`. At least Apache and SQLite could perhaps get by solely with my home directory... – Slazer May 12 '16 at 22:11