Benchmarking CPU performance
We can use benchmarks such as Linpack (http://www.netlib.org/linpack/) and sysbench (https://github.com/nuodb/sysbench) to benchmark CPU performance. For this recipe, we'll use sysbench. We'll see how to run a benchmark on bare metal and inside the container. Similar steps can be performed in other environments, like we mentioned previously.
Getting ready
We will use the CentOS 7 container to run the benchmark inside the container. Ideally, we should have a system with CentOS 7 installed to get benchmark results on bare metal. For the container test, let's build the image from the Git repository that we referred to earlier:
$ git clone https://github.com/redhat-performance/docker-performance.git $ cd docker-performance/Dockerfiles/ $ docker image build -t c7perf --rm . $ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE c7perf latest 59a10df39a82 1 minute ago 678.3 MB
How to do it…
Inside the...