加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Docker并行操作限制

发布时间:2020-12-16 03:45:45 所属栏目:安全 来源:网络整理
导读:您可以执行并行Docker推/拉的数量是否有限制? E.g. if you thread Docker pull / push commands such that they are pulling/pushing different images at the same time what would be the upper limit to the number of parallel push/pulls 或者 On one

您可以执行并行Docker推/拉的数量是否有限制?

E.g. if you thread Docker pull / push commands such that they are
pulling/pushing different images at the same time what would be the
upper limit to the number of parallel push/pulls

或者

On one terminal you do docker pull ubuntu on another you do docker
pull httpd etc – what would be the limit Docker would support?

最佳答案
docker守护进程(dockerd)有两个标志:

  --max-concurrent-downloads int          Set the max concurrent downloads for each pull
                                          (default 3)
  --max-concurrent-uploads int            Set the max concurrent uploads for each push
                                          (default 5)

上限可能取决于您允许进程的打开文件数(ulimit -n).其他docker文件句柄会有一些开销,我希望每次推拉都会打开多个句柄,一个用于远程连接,另一个用于本地文件存储.

为了加剧这种复杂性,图像的每次推拉将打开多个连接,每层一个,直到并发限制.因此,如果你运行十几个并发拉,你可能有50-100个潜在的层.

虽然docker确实允许增加这些限制,但是如果不是打开更多并发连接的负返回,那么你会看到收益递减的实际限制.假设远程注册表的带宽有限,更多连接将简单地分割该带宽,并且docker本身将等到第一层完成之后才开始解压缩该传输.此外,任何中止的docker pull或push都将丢失一个层的任何部分传输,因此您需要使用更多并发连接来增加重新传输所需的潜在数据.

默认限制非常适合开发环境,如果您发现需要调整它们,我建议在尝试查找最大并发会话数之前测量性能改进.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读