【原创】运维基础之Docker(6)性能
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)性能的更多相关文章
- 【原创】运维基础之Docker(1)简介、安装、使用
docker 18.09 官方:https://docs.docker.com/ 一 简介 Docker is a platform for developers and sysadmins to d ...
- 【原创】运维基础之Docker(2)通过docker部署zookeeper nginx tomcat redis kibana/elasticsearch/logstash mysql kafka mesos/marathon
通过docker可以从头开始构建集群,也可以将现有集群(配置以及数据)平滑的迁移到docker部署: 1 docker部署zookeeper # usermod -G docker zookeeper ...
- 【原创】运维基础之Docker(3)搭建私有仓库
下载并启动registry $ docker pull registry$ docker run --name my_registry -d -p 5000:5000 -v /var/lib/regi ...
- 【原创】运维基础之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 ...
- 【原创】运维基础之Docker(5)docker部署airflow
部署方式:docker+airflow+mysql+LocalExecutor 使用airflow的docker镜像 https://hub.docker.com/r/puckel/docker-ai ...
- 【原创】运维基础之Docker(4)实用工具ctop
ctop类似于top,top监控的是进程,ctop监控的是容器(container top) 安装 # wget https://github.com/bcicen/ctop/releases/dow ...
- Linux运维基础
一.服务器硬件 二.Linux的发展史 三.Linux的系统安装和配置 四.Xshell的安装和优化 五.远程连接排错 六.Linux命令初识 七.Linux系统初识与优化 八.Linux目录结构 九 ...
- 第一阶段·Linux运维基础-第1章·Linux基础及入门介绍
01-课程介绍-学习流程 02-服务器硬件-详解 03-服务器核心硬件-服务器型号-电源-CPU 01-课程介绍-学习流程 1.1. 光看不练,等于白干: 1.2 不看光练,思想怠慢: 1.3 即看又 ...
- linux运维基础知识
linux运维基础知识大全 一,序言 每一个微不足道的知识,也是未来的铺垫.每一份工作的薪资职位,也是曾经努力的结果. 二,服务器 1,运维人员工作职责: 1)保证数据不丢失:2)保证服务器24小时运 ...
随机推荐
- mysql查询表达式解析
1.mysql> SHOW COLUMNS FROM users;+----------+----------------------+------+-----+---------+------ ...
- mysql单表删除记录DELETE
DELETE FROM tbl_name [WHERE where_condition] mysql> SELECT * FROM users;+----+----------+------- ...
- JS算法练习四
JS算法练习 1.将使用空格分隔单词使用驼峰命名连接起来: var str="HELLO world welcome to my hometown"; /*--先输入一个有空格分隔 ...
- git 配置ssh key
第一次生成 ssh key 进入ssh目录 cd ~/.ssh,再输入:ls ,查看文件,如果有.pub的文件,说明已有ssh key 如果没有, 则生成秘钥:ssh-keygen -t rsa - ...
- Java基础_0205: 程序逻辑结构
使用if语句进行判断 public class TestDemo { public static void main(String args[]) { double score = 90.0; // ...
- GDI+学习---1.初识GDI+
---恢复内容开始--- GDI+: GDI+由一组C++类实现,是对于GDI的继承,GDI+不仅优化了大部分GDI性能而且提供了更多特性.允许应用程序开发者将信息显示在显示器或者打印机上,而无需考虑 ...
- JQ中的 offsetTop 和 offset().top 的区别
话不多说先上图: offset()的top是指元素与document的上边的距离,而不是浏览器当前窗体的上边缘,如图 document高度超过window,浏览器出现滚动条,滚动滚动条,提交按钮的of ...
- call 和 apply 的区别
call 和 apply 都是为了改变某个函数运行时的 context 即上下文而存在的,换句话说,就是为了改变函数体内部 this 的指向.因为 JavaScript 的函数存在「定义时上下文」和「 ...
- 读Java并发编程实践中,向已有线程安全类添加功能--客户端加锁实现示例
在Java并发编程实践中4.4中提到向客户端加锁的方法.此为验证示例,写的不好,但可以看出结果来. package com.blackbread.test; import java.util.Arra ...
- linux 安装图行界面
centos6的环境中 代码:[root@ebs122 sysconfig]#yum groupinstall "Desktop" 使用 init 5命令进入图形化界面,如果成功的 ...