📜 ⬆️ ⬇️

Docker containers slightly increase server power consumption


Power consumption of a computer with Linux OS and Docker service without any load (without loading the container)

Virtualization offers many benefits, especially for isolating processes and controlling resources. Deploying software has never been easier with images of a complete and configured system. The work of the hypervisor for virtual machines meant the simultaneous operation of two cores of the operating system. Therefore, a lightweight alternative to virtual machines has emerged - containers that are now rapidly replacing virtual machines as the most optimal way of virtualization.

Since two operating system cores do not work in containers at the same time as in virtual machines, it would seem that they should have the same power consumption as with a normal operating system. But it is not. Comparative testing of Linux and Docker showed that the power consumption of Docker containers is slightly higher.

Experts from the Computer Science Department at the University of Alberta (Canada) compared the power consumption of servers with standard Docker containers and Linux servers for the same tasks. To run tasks on the test server and to record the measurement results, a separate machine (test runner) of the Dell PowerEdge R710 of the same hardware configuration was used.
')

Dell PowerEdge R710 Test Server Hardware Configuration:


Software versions on the test server:
SoftwareVersionDocker image
DistributiveUbuntu Server 16.04.1 LTS
CoreLinux 4.4.0
Docker1.12.1
Apache2.4.10php: 5.6-apache
Php5.6.24php: 5.6-apache
Mysql5.7.15mysql: 5.7.15
Wordpress4.6.0wordpress: 4.6-apache
Redis3.2.3redis: 3.2.3
PostgreSQL9.5.4postgres: 9.5.4

Energy consumption measured wattmeter. This is the most objective test, because this is how the total consumption of the system is measured - the processor, memory, network, and even the overhead of the power supply. Wattmeter gives the average value every second (RMS). As practice has shown , such accuracy is sufficient for correct measurements. The data was recorded by a modified version of the program yyongpil's wattsup .

To begin with, the power consumption of a computer running Linux and Docker service was measured as a “baseline” level without any load (without loading the container). During each test, the server worked without load for 10 minutes, and the test was repeated 40 times. The results are shown in the very first diagram in the article. Increased power consumption is caused by the dockerd background process. This server, written in the Go programming language, wakes up periodically, even if there is not a single running container. The study showed that it calls various Go functions for garbage collection and scheduling (runtime.findrunnable, runtime.scanobject, runtime.heapBitsForObject, runtime.greyobject).

Then, the researchers sequentially launched under Linux and in the container three tasks Redis, WordPress and PostgreSQL - and processed the results using various statistical methods. Graphically, the results are most clearly shown as violin charts and density maps. Violin charts well illustrate the statistical distribution of indicators. For example, this is the graph for Linux and Docker without load.


But the violin chart for the test with WordPress.


And the density map for it is the same, which also shows the distribution of the load and energy consumption over time.



As you can see, in the case of the WordPress task, the difference in energy consumption is also great. In this test, a blog was generated using WP Example Content Plugin 1.3, and then the HTTP load was simulated using Tsung 1.6.0.

For PostgreSQL, the difference in power consumption is not so noticeable, but in the case of Redis, the situation is aggravated by the fact that in the Docker container the test took more time to complete.

Violin chart for Redis.



Density map for it.



The work of all the tests took a total of 2 days and 20 hours, but the researchers managed to collect comprehensive and objective statistics. It turned out that simply running the dockerd background process without performing tasks increases the power consumption by 2 watts. Further, in the case of Redis and WordPress, the increase in power consumption is largely due to a decrease in performance. Since the work is done in a container, it takes more time, which leads to an increase in overall energy consumption.

Researchers emphasize that using containers should take into account increased energy consumption. But it should be remembered about the big savings in maintenance and support of containers, compared with the usual software installations on the server. The benefits of convenience and time savings can greatly outweigh the losses on energy consumption, especially since these losses are not that disastrous, and one can say, minimal.

The scientific work was published on May 2, 2017 on the site of preprints arXiv.org (arXiv: 1705.01176).

Source: https://habr.com/ru/post/328144/


All Articles