Perforce Helix Server (p4d) Benchmarking with Docker === Overview --- 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. Directory structure --- 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. Benchmark documentations --- * [KB Article](http://answers.perforce.com/articles/KB/5358) 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. Instructions for Benchmarks == * Sync the workspace containing this README! * Create the directory structure as described above * Download p4 & p4d and put into ./p4/bin * Download the zipped checkpoint and put into ./p4/ckps * Create Docker container * Run benchmarks (see below) Creating Docker files --- Assume current directory is ~/benchmark Run the following: * ./build_docker.sh Running the Branchsubmit benchmark --- Run the following: * cd p4 * ./branchsubmit.sh setup * ./branchsubmit.sh runme * ./branchsubmit.sh runme * ./branchsubmit.sh runme 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: * cd ~/benchmark * ./run_branchsubmit_in_docker.sh * ./run_branchsubmit_in_docker.sh * ./run_branchsubmit_in_docker.sh Note that the script defaults to the "runme" action. Running the Browse benchmark --- You will need a valid license file (in p4/licenses) for this test. Ask support for a temporary one if necessary. Run the following: * cd ~/benchmark * ./run_browse_p4d_native.sh * cd p4 * ./browse.sh runme * ./browse.sh runme * ./browse.sh runme The above starts the native p4d server first and then runs benchmarks against it. Run the Docker version: * p4 -p 3697 admin stop * cd ~/benchmark * ./run_browse_p4d_in_docker.sh From another terminal window: * cd ~/benchmark/p4 * ./browse.sh runme * ./browse.sh runme * ./browse.sh runme 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. Troubleshooting --- 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.