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.

Spec

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.

Results

1 2 3 4 5 6 7 8 9 10 Mean Standard Dev. Native 8600 8812 8852 8868 8385 8181 8020 7946 7031 6322 8101.7 795.88 Docker 8677 8789 8839 8865 8379 8170 8008 7936 7068 6367 8109.8 782.59 Difference (%) 0.89 -0.26 -0.15 -0.03 -0.07 -0.13 -0.15 -0.13 0.52 0.71 0.12 0.4

Even stevens.

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.

Results

4 8 Average Native 8816 7875 8345.5 Docker 8814 7909 8361.5 Difference (%) -0.02 0.42 0.19

Same again, no difference.

Summary

The PegNet miner likely does not suffer any performance penalty when run inside a Docker container.