The general result is that Docker is nearly identical to Native performance and faster than KVM in every category.

1 CPU

2 Memory

3 Network

Docker’s use of bridging and NAT noticeably increases the transmit path length; vhost-net is fairly efficient at transmitting but has high overhead on the receive side. Containers that do not use NAT have identical performance to native Linux.

NAT, as used in Docker, doubles latency in this test. KVM adds 30µs of overhead to each transaction compared to the non-virtualized network stack, an increase of 80%.

4 Disk

5 Other

5.1 redis

5.2 mysql

可见除了Network之外,docker非常接近native,
带宽测试:nuttcp (http://www.nuttcp.net/)
延迟测试:netperf (http://netperf.org/netperf/)
而docker network中常用的host和bridge差别也很大,对nginx压测数据如下:

1)native

# ./http_load -p 10 -s 10 urls/raw_nginx.urls
274791 fetches, 10 max parallel, 1.78339e+08 bytes, in 10.0001 seconds
649 mean bytes/connection
27478.9 fetches/sec, 1.78338e+07 bytes/sec
msecs/connect: 0.0345773 mean, 0.445 max, 0.011 min
msecs/first-response: 0.310406 mean, 1.026 max, 0.088 min
HTTP response codes:
code 200 -- 274791

2)docker network-host

# ./http_load -p 10 -s 10 urls/docker_host_nginx.urls
202773 fetches, 10 max parallel, 1.316e+08 bytes, in 10 seconds
649 mean bytes/connection
20277.3 fetches/sec, 1.31599e+07 bytes/sec
msecs/connect: 0.0426044 mean, 0.897 max, 0.013 min
msecs/first-response: 0.423675 mean, 1.401 max, 0.076 min
HTTP response codes:
code 200 -- 202773

3)docker network-bridge

# ./http_load -p 10 -s 10 urls/docker_bridge_nginx.urls
80282 fetches, 10 max parallel, 5.2103e+07 bytes, in 10 seconds
649 mean bytes/connection
8028.2 fetches/sec, 5.2103e+06 bytes/sec
msecs/connect: 0.0522431 mean, 0.489 max, 0.014 min
msecs/first-response: 1.17323 mean, 10.748 max, 0.122 min
HTTP response codes:
code 200 -- 80282

几种部署的nginx结果如下:使用native可以达到27k的tps,使用docker network-host可以达到20k的tps(下降24%),使用docker network-bridge(默认)可以达到8k的tps(下降70%);

参考:

docker network

https://docs.docker.com/network/

An Updated Performance Comparison of Virtual Machines and Linux Containers

https://domino.research.ibm.com/library/cyberdig.nsf/papers/0929052195DD819C85257D2300681E7B/$File/rc25482.pdf

【原创】运维基础之Docker(6)性能的更多相关文章

  1. 【原创】运维基础之Docker(1)简介、安装、使用

    docker 18.09 官方:https://docs.docker.com/ 一 简介 Docker is a platform for developers and sysadmins to d ...

  2. 【原创】运维基础之Docker(2)通过docker部署zookeeper nginx tomcat redis kibana/elasticsearch/logstash mysql kafka mesos/marathon

    通过docker可以从头开始构建集群,也可以将现有集群(配置以及数据)平滑的迁移到docker部署: 1 docker部署zookeeper # usermod -G docker zookeeper ...

  3. 【原创】运维基础之Docker(3)搭建私有仓库

    下载并启动registry $ docker pull registry$ docker run --name my_registry -d -p 5000:5000 -v /var/lib/regi ...

  4. 【原创】运维基础之Docker(7)关于docker latest tag

    Docker images have a tag named latest which doesn’t work as you expect.Latest is just a tag with a s ...

  5. 【原创】运维基础之Docker(5)docker部署airflow

    部署方式:docker+airflow+mysql+LocalExecutor 使用airflow的docker镜像 https://hub.docker.com/r/puckel/docker-ai ...

  6. 【原创】运维基础之Docker(4)实用工具ctop

    ctop类似于top,top监控的是进程,ctop监控的是容器(container top) 安装 # wget https://github.com/bcicen/ctop/releases/dow ...

  7. Linux运维基础

    一.服务器硬件 二.Linux的发展史 三.Linux的系统安装和配置 四.Xshell的安装和优化 五.远程连接排错 六.Linux命令初识 七.Linux系统初识与优化 八.Linux目录结构 九 ...

  8. 第一阶段·Linux运维基础-第1章·Linux基础及入门介绍

    01-课程介绍-学习流程 02-服务器硬件-详解 03-服务器核心硬件-服务器型号-电源-CPU 01-课程介绍-学习流程 1.1. 光看不练,等于白干: 1.2 不看光练,思想怠慢: 1.3 即看又 ...

  9. linux运维基础知识

    linux运维基础知识大全 一,序言 每一个微不足道的知识,也是未来的铺垫.每一份工作的薪资职位,也是曾经努力的结果. 二,服务器 1,运维人员工作职责: 1)保证数据不丢失:2)保证服务器24小时运 ...

随机推荐

  1. SQL Server进阶(六)表表达式--派生表、公用表表达式(CTE)、视图和内联表值函数

    概述 表表达式是一种命名的查询表达式,代表一个有效地关系表.可以像其他表一样,在数据处理中使用表表达式. SQL Server支持四种类型的表表达式:派生表,公用表表达式,视图和内联表值函数. 为什么 ...

  2. ext Ext.grid.去除右边空白

    1.当Scroll没有显示时,Ext.grid右边会显示一个空白间隔. 2.解决办法<View> <ext:GridView ForceFit="true" Sc ...

  3. 动态字段列表实现及List<T>排序

    public class StudentCardSortHelper<T> { //itemName 要排序的字段名 public static List<StudentCard&g ...

  4. JDK8新特性01 Lambda表达式01_设计的由来

    1.java bean public class Employee { private int id; private String name; private int age; private do ...

  5. zookeeper客户端 zkCli使用及常用命令

    上篇(http://www.cnblogs.com/yangzhenlong/p/8270835.html)zk伪集群搭建好后,使用zkCli连接zk服务 切换到zk1/bin 目录,执行zkCli. ...

  6. dbms_redefinition在线重定义表结构

    dbms_redefinition在线重定义表结构 (2013-08-29 22:52:58) 转载▼ 标签: dbms_redefinition 非分区表转换成分区表 王显伟 在线重定义表结构 在线 ...

  7. 第20月第14天 objc_getAssociatedObject _cmd

    1. - (CustomNavigationControllerDelegate *)customDelegate { return objc_getAssociatedObject(self, _c ...

  8. python之第三方模块安装

    1. 直接打开cmd窗口运行 pip install xxx   #可联网情况下使用,联网下载 xxx表示要安装的模块名称 pip问题及解决方法: 1. 配置环境变量,将如下两个路径都加到系统path ...

  9. 【译】第十篇 SQL Server安全行级安全

    本篇文章是SQL Server安全系列的第十篇,详细内容请参考原文. 不像一些其他industrial-strength数据库服务,SQL Server缺乏一个内置保护个别数据记录的机制,称为行级安全 ...

  10. mouseover,mouseout与mouseenter,mouseleave

    针对单个元素,使用感一样. 差异提现在有子元素的情况下: mouseover和mouseout在父元素和其子元素都可以触发,当鼠标穿过一个元素时,触发次数得依子元素数量而言. mouseenter和m ...