An interesting question came up recently on the PegNet Discord server: will the performance of a PegNet miner be degraded if ran inside a Docker container? IBM looked into how containers perform relative to native applications back in 2014. They found that CPU performance was broadly similar between Docker and native applications. This is perhaps unsurprising, as a Docker container is running directly on top of the kernel; there is no separate OS as you would find with a conventional VM. Nevertheless, there remains some uncertainty as to whether or not those results can be extrapolated to the PegNet miner. I decided to run my own benchmarks to find out.
All tests carried out under the following conditions:
- Ubuntu 18.04 running on a dedicated host.
- i7-8559U CPU @ 2.70GHz 32 GB
- Go 1.12.7
- Docker 18.09.8
Benchmark 1: LXRHash
These tests are a basic comparison of LXRHash performance in Docker relative to native performance using WhoSoup's benchmarking tool. Benchmarks were performed for 1 to 10 miners, with the hashrate per miner outlined in the table.
Benchmark 2: PegNet Miner
These tests looked at the relative performance of the PegNet miner when running against a local factomd network with 10 minute block times. Each test was performed over a period of 3 blocks, with tests for 4 and 8 miners.
Same again, no difference.
The PegNet miner likely does not suffer any performance penalty when run inside a Docker container.