This set of scripts and results shows how benchmarks were run to compare native p4d performance with performance when p4d is run inside a Docker container.
By syncing all the files as part of this benchmarking project you will get the following directories (assuming a root of ~/benchmark):
$BENCHMARK/* [scripts]
$BENCHMARK/p4 [basic benchmark scripts]
$BENCHMARK/p4/docker [Dockerfile and scripts]
Other directories which you should create manually:
~/benchmark$ find . -type d
./p4/root [db.* files for both benchmarks]
./p4/root/branchsubmit
./p4/ckps [checkpoint downloaded as part of benchmark]
./p4/logs [p4d logs (subdirs per benchmark)]
./p4/logs/branchsubmit
./p4/logs/browse
./p4/bin [p4d and p4 under test (r16.1)]
./p4/clients [root for clients created (subdirs per benchmark)]
./p4/clients/branchsubmit
./p4/clients/browse
./p4/journals [p4d journal (subdirs per benchmark)]
./p4/journals/branchsubmit
./p4/journals/browse
./p4/bin.linux26x86_64 [client application for browse benchmark]
./p4/licenses [license required for browse benchmark]
Note that there is a symlink in ./root/browse so that it shares the db.* files with the other benchmark.
You will not need browse.sh and branchsubmit.sh as the customised versions are in the p4 directory. You will need to download the basic checkpoint (dataset), and also browse.tgz which includes binaries for the browse benchmark client.
Assume current directory is ~/benchmark
Run the following:
Run the following:
This restores db.* from checkpoint (takes 10-20 minutes so you don't want to do it all the time). It then runs the native p4d benchmark several times (which warms up file system cache).
Run the Docker version:
Note that the script defaults to the "runme" action.
You will need a valid license file (in p4/licenses) for this test. Ask support for a temporary one if necessary.
Run the following:
The above starts the native p4d server first and then runs benchmarks against it.
Run the Docker version:
From another terminal window:
Note that the docker process may result in some files such as p4d log file being written with root permissions (because Docker server has root), so you will need to delete that file (e.g. using sudo) if you want to start up the native p4d again.
If you get errors with TCP connections not able to be made when running browse benchmark, then adjust free tcp ports - search web for "sysctl net.ipv4.ip_local_port_range" - I found changing the range to "15000 61000" was sufficient.