Docker micro benchmark is a tool aimed at benchmarking docker operations
which are critical to K8s performance, such as docker ps, docker inspect etc.
Docker micro benchmark benchmarks the following docker operations:
- docker ps [-a]: K8s does periodically- docker ps -ato detect container state changes, so its performance is crutial to K8s.
- docker inspect: K8s does- docker inspectto get detailed information of specific container when it finds out a container state is changed. So inspect is also relatively frequent.
- docker create&- docker start: The performance of- docker createand- docker startare important for K8s when creating pods, especially for batch creation.
- docker stop&- docker remove: The same with above.
Docker micro benchmark supports 4 kinds of benchmarks:
- Benchmark docker ps,docker ps -aanddocker inspectwith different number of dead and alive containers.
- Benchmark docker ps,docker ps -aanddocker inspectwith different operation interval.
- Benchmark docker ps -aanddocker inspectwith different number of goroutines.
- Benchmark docker create & docker startanddocker stop & docker removewith different operation rate limit.
- golang
- sysstat
- gnuplot
go build github.com/random-liu/docker_micro_benchmark
benchmark.sh is the script starting the benchmark.
Usage : benchmark.sh -[o|c|i|r]:
- -o: Run docker create/start/stop/removebenchmark.
- -c: Run docker list/inspectwith different number of containers benchmark. Notice that containers created in this benchmark won't be removed before benchmark is over. That's intendend because creating containers is really slow, it's better to reuse these containers in the following benchmark. If you want to remove all the containers, just runshell/kill_all_container.sh.
- -i: Run docker list/inspectwith different operation interval.
- -r: Run docker list/inspectwith different number of goroutines.
You can run benchmark.sh with multiple options, the script will run benchmarks
corresponding to each of the options one by one. Notice that it's better to put
-c in front of -i and -r, so that they can reuse the containers created in
-c benchmark.
After the benchmark finishes, all benchmark result will be generated in result/
directory. Different benchmark results locate in different sub-directory.
There are two forms of benchmark result:
- *.dat: Table formatted text result.
- *.png: Graph result auto-generated from the text result. Notice that there
is no graph for sarresult. If you want to analyse the data insarresult, you can use another tool kSar.
Here are links of some previous benchmark results: