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?
As mentioned in "Mount a shared-storage volume as a data volume"
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:
Any folder which include persistent data, and/or has an high volume of IO operations.