docker中pull和push的性能有什么不同
发表于:2024-12-04 作者:千家信息网编辑
千家信息网最后更新 2024年12月04日,这篇文章主要介绍了docker中pull和push的性能有什么不同,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。0. 测试环境基本架构
千家信息网最后更新 2024年12月04日docker中pull和push的性能有什么不同
这篇文章主要介绍了docker中pull和push的性能有什么不同,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
0. 测试环境
基本架构:没有docker index,所有操作发生在daemon和registry之间
镜像:
# docker images --tree Warning: '--tree' is deprecated, it will be removed soon. See usage.├─9247a3750813 Virtual Size: 85.1 MB│ └─a92b1d9f0ca5 Virtual Size: 1.078 GB Tags: 10.180.156.6:5000/bigtest2:latest
网络环境:docker daemon和registry之间为千兆网络,带宽足够大。
1. docker push 日志分析及registry put对比测试
在客户端做一次docker push的时候,观察registry端日志,刨去无关的一些日志后,如下:
10.180.156.11 - - [02/Apr/2015:03:25:55 +0000] "GET /v2/ HTTP/1.1" 404 233 "-" "Go 1.1 package http"10.180.156.11 - - [02/Apr/2015:03:25:55 +0000] "GET /v1/_ping HTTP/1.1" 200 2 "-" "Go 1.1 package http"02/Apr/2015:03:25:55 +0000 DEBUG: args = {'namespace': 'library', 'repository': u'bigtest2'}02/Apr/2015:03:25:55 +0000 ERROR: 10.180.156.11 - - [02/Apr/2015:03:25:55 +0000] "PUT /v1/repositories/bigtest2/ HTTP/1.1" 200 2 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:25:55 +0000 DEBUG: args = {'image_id': u'9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f'}02/Apr/2015:03:25:55 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}02/Apr/2015:03:25:55 +0000 DEBUG: api_error: Image not found10.180.156.11 - - [02/Apr/2015:03:25:55 +0000] "GET /v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/json HTTP/1.1" 404 28 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:25:55 +0000 DEBUG: api_error: Image not found10.180.156.11 - - [02/Apr/2015:03:25:55 +0000] "GET /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1" 404 28 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:25:55 +0000 DEBUG: args = {'image_id': u'9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f'}10.180.156.11 - - [02/Apr/2015:03:25:56 +0000] "PUT /v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/json HTTP/1.1" 200 4 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"===3秒===02/Apr/2015:03:25:57 +0000 DEBUG: args = {'image_id': u'9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f'}===34秒===10.180.156.11 - - [02/Apr/2015:03:26:31 +0000] "PUT /v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer HTTP/1.1" 200 4 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:26:31 +0000 DEBUG: args = {'image_id': u'9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f'}10.180.156.11 - - [02/Apr/2015:03:26:31 +0000] "PUT /v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/checksum HTTP/1.1" 200 4 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:26:31 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}10.180.156.11 - - [02/Apr/2015:03:26:32 +0000] "PUT /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1" 200 4 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"===6秒===02/Apr/2015:03:26:37 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}===325秒===10.180.156.11 - - [02/Apr/2015:03:32:02 +0000] "PUT /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer HTTP/1.1" 200 4 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:32:02 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}10.180.156.11 - - [02/Apr/2015:03:32:03 +0000] "PUT /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/checksum HTTP/1.1" 200 4 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:32:03 +0000 DEBUG: args = {'tag': u'latest', 'namespace': 'library', 'repository': u'bigtest2'}02/Apr/2015:03:32:03 +0000 DEBUG: [put_tag] namespace=library; repository=bigtest2; tag=latest10.180.156.11 - - [02/Apr/2015:03:32:03 +0000] "PUT /v1/repositories/bigtest2/tags/latest HTTP/1.1" 200 4 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:03:32:03 +0000 DEBUG: args = {'images': True, 'namespace': 'library', 'repository': u'bigtest2'}10.180.156.11 - - [02/Apr/2015:03:32:03 +0000] "PUT /v1/repositories/bigtest2/images HTTP/1.1" 204 - "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"
可以发现,对于一个2层的镜像,整个push的时间可以分成几段
操作 | 耗时 | 百分比 |
---|---|---|
put json1 | 3s | 0.8% |
put layer1 | 34s | 9.2% |
put json2 | 6s | 1.6% |
put layer2 | 325s | 87.6% |
总耗时 | 371s | 100% |
也就是说,在做put layer1和put layer2时消耗了96.8%的时间。那么,纯的对registry服务做同样文件的PUT操作,会消耗多少时间呢?
# time curl -X PUT -H "Transfer-Encoding: chunked" --data-binary @layer-a92b1 "http://10.180.156.6:5000/v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer"truereal 0m44.571suser 0m0.302ssys 0m1.341s# time curl -X PUT -H "Transfer-Encoding: chunked" --data-binary @layer-9247a "http://10.180.156.6:5000/v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer"truereal 0m4.277suser 0m0.029ssys 0m0.130s
2. docker pull 日志分析及registry get对比测试
类似上个节,继续做pull的日志分析
10.180.156.11 - - [02/Apr/2015:08:54:16 +0000] "GET /v2/ HTTP/1.1" 404 233 "-" "Go 1.1 package http"10.180.156.11 - - [02/Apr/2015:08:54:16 +0000] "GET /v1/_ping HTTP/1.1" 200 2 "-" "Go 1.1 package http"02/Apr/2015:08:54:16 +0000 DEBUG: args = {'namespace': 'library', 'repository': u'bigtest2'}10.180.156.11 - - [02/Apr/2015:08:54:16 +0000] "GET /v1/repositories/bigtest2/images HTTP/1.1" 200 152 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:08:54:16 +0000 DEBUG: args = {'namespace': u'library', 'repository': u'bigtest2'}02/Apr/2015:08:54:16 +0000 DEBUG: [get_tags] namespace=library; repository=bigtest210.180.156.11 - - [02/Apr/2015:08:54:16 +0000] "GET /v1/repositories/library/bigtest2/tags HTTP/1.1" 200 78 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:08:54:16 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}10.180.156.11 - - [02/Apr/2015:08:54:16 +0000] "GET /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/ancestry HTTP/1.1" 200 136 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:08:54:16 +0000 DEBUG: args = {'image_id': u'9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f'}10.180.156.11 - - [02/Apr/2015:08:54:17 +0000] "GET /v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/json HTTP/1.1" 200 619 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:08:54:17 +0000 DEBUG: args = {'image_id': u'9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f'}===6秒===10.180.156.11 - - [02/Apr/2015:08:54:23 +0000] "GET /v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer HTTP/1.1" 200 37124367 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:08:54:24 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}===42秒===02/Apr/2015:08:55:06 +0000 DEBUG: api_error: Image not found10.180.156.11 - - [02/Apr/2015:08:55:06 +0000] "GET /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1" 404 28 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:08:55:06 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}10.180.156.11 - - [02/Apr/2015:08:55:06 +0000] "GET /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/json HTTP/1.1" 200 1172 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"02/Apr/2015:08:55:07 +0000 DEBUG: args = {'image_id': u'a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5'}===2秒===10.180.156.11 - - [02/Apr/2015:08:56:08 +0000] "GET /v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer HTTP/1.1" 200 420084375 "-" "docker/1.5.0 go/go1.4.1 git-commit/a8a31ef kernel/3.13.0-32-generic os/linux arch/amd64"
可以发现,对于一个2层的镜像,整个pull的时间可以分成几段
操作 | 耗时 | 百分比 |
---|---|---|
get json1 | 6s | 5.1% |
get layer1 | 42s | 36.2% |
get json2 | 0s | 0% |
get layer2 | 2s | 1.7% |
总耗时 | 116s | 100% |
对比直接从registry上get测试
# time curl -X GET -H "Transfer-Encoding: chunked" -o layer-9247a-down "http://10.180.156.6:5000/v1/images/9247a37508136a5fe916f4f87bfa2aa47f2edf8fc1a1ce787445b606d8fdbf9f/layer" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 35.4M 100 35.4M 0 0 25.3M 0 0:00:01 0:00:01 --:--:-- 25.3Mreal 0m1.409suser 0m0.036ssys 0m0.233s
# time curl -X GET -H "Transfer-Encoding: chunked" -o layer-a92b1-down "http://10.180.156.6:5000/v1/images/a92b1d9f0ca59cefd024a5f2f2d23e2d617b3e67cc2363c94998006fa87e60e5/layer" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 400M 100 400M 0 0 19.2M 0 0:00:20 0:00:20 --:--:-- 24.5Mreal 0m20.771suser 0m0.381ssys 0m2.501s
感谢你能够认真阅读完这篇文章,希望小编分享的"docker中pull和push的性能有什么不同"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!
日志
时间
篇文章
测试
镜像
分析
不同
性能
之间
环境
百分
百分比
网络
消耗
也就是
也就是说
价值
兴趣
同时
客户
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
一个大数据服务器架构
和平精英高端服务器要求
手机服务器繁忙一直进不去怎么办
网络安全小卫士班会
网络安全类别是什么意思
网络安全法研讨材料
科技互联网推广方式渠道
淘宝分享服务器出现错误怎么办
数据库安装在那盘
合肥众诚软件开发公司
c#如何查询数据库的数据
广告erp软件开发
服务器维护需要花钱吗
网络安全 中长期规划
拖动排序怎么数据库字段
数据库模糊查找字符串
万方数据库关键字检索
软件开发教学平台教学视频
长泰网络安全服务
服务器的远程桌面
计算机设置为一台服务器
护卫神数据库连接1045
泉州网络安全实战特训营哪家好
电脑关机rpc服务器不可用
网络安全拓扑图如何绘制
网络安全主题宣传活动
进货统计数据库
网络安全制度相关内容
永昌南收费站到武威有服务器吗
互联网科技近代发展