Docker容器的运行时性能成本是多少? [英] What is the runtime performance cost of a Docker container

查看:186
本文介绍了Docker容器的运行时性能成本是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想全面了解Docker容器的运行时性能成本。我已经找到网络传播速度低于100μs的引用



我还发现运行时成本是可忽略的和接近零的引用,但我想了解更多正是这些成本是什么。理想情况下,我想知道Docker是如何抽象出性能成本的,而且在没有性能成本的情况下抽象出来的东西。网络,CPU,内存等。



此外,如果有抽象成本,有没有办法解决抽象成本。例如,也许我可以直接安装一个磁盘,而不是在Docker中安装一个磁盘。

解决方案

这是一个很好的2014年IBM研究论文,题目是虚拟机和Linux容器的更新性能比较Felter等这提供了裸机,KVM和Docker容器之间的比较。一般的结果是Docker几乎与Native性能相同,比KVM在每个类别都快。



这个例外是Docker的NAT - 如果您使用端口映射(例如 docker run -p 8080:8080 ),则可以预期延迟时间稍微下降,如下所示。但是,当启动Docker容器时,您现在可以使用主机网络堆栈(例如 docker run --net = host ),这将与 Native 列(如Redis延迟结果所示)。





他们还对几个特定服务(如Redis)进行了延迟测试。您可以看到20个以上的客户端线程,最高的延迟时间开销转移到Docker NAT,然后是KVM,然后是Docker主机/本机的粗暴搭配。





只是因为它是一个非常有用的文章,这里有一些其他的数字。请下载,以便完全访问。



查看磁盘IO:





现在查看CPU开销:





现在一些记忆的例子(详细阅读文章,记忆可以是非常棘手的)




I'd like to comprehensively understand the run-time performance cost of a Docker container. I've found references to networking anecdotally being ~100µs slower.

I've also found references to the run-time cost being "negligible" and "close to zero" but I'd like to know more precisely what those costs are. Ideally I'd like to know what Docker is abstracting with a performance cost and things that are abstracted without a performance cost. Networking, CPU, memory, etc.

Furthermore, if there are abstraction costs, are there ways to get around the abstraction cost. For example, perhaps I can mount a disk directly vs. virtually in Docker.

解决方案

Here is an excellent 2014 IBM research paper titled "An Updated Performance Comparison of Virtual Machines and Linux Containers" by Felter et al. that provides a comparison between bare metal, KVM, and Docker containers. The general result is that Docker is nearly identical to Native performance and faster than KVM in every category.

The exception to this is Docker's NAT - if you use port mapping (e.g. docker run -p 8080:8080) then you can expect a minor hit in latency, as shown below. However, you can now use the host network stack (e.g. docker run --net=host) when launching a Docker container, which will perform identically to the Native column (as shown in the Redis latency results lower down).

They also ran a latency tests on a few specific services, such as Redis. You can see that above 20 client threads, highest latency overhead goes Docker NAT, then KVM, then a rough tie for Docker host/native.

Just because it's a really useful paper, here are some other figures. Please download it for full access.

Taking a look at Disk IO:

Now looking at CPU overhead:

Now some examples of memory (read the paper for details, memory can be extra tricky)

这篇关于Docker容器的运行时性能成本是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆