Docker Engine可以并行启动容器吗 [英] Can Docker Engine start containers in parallel

查看:73
本文介绍了Docker Engine可以并行启动容器吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有并行发布docker run命令的脚本,则docker引擎似乎可以串行处理这些命令.由于使用"docker run"运行最小的容器映像需要大约100ms的启动时间,这是否意味着并行发出命令以运行1000个容器将花费docker引擎100ms x 1000 = 100 s或近2分钟?docker引擎是串行而不是并行的某些原因吗?人们如何解决这个问题?

解决方案

人们如何解决这个问题?

a/他们不会同时启动1000个容器b/如果这样做,他们可能会使用集群管理系统(如docker swarm)来管理所有流程c/他们确实预先运行了1000个容器,以便考虑开始时间.

完全并行化 docker run 命令可能很棘手,考虑到其中某些命令可能首先依赖于其他容器的创建/启动(例如 docker run --volumes-from = xxx )

If I have scripts issueing docker run commands in parallel, the docker engine appears to handle these commands in series. Since runing a minimal container image with "docker run" takes around 100ms to start does this mean issueing commands in parallel to run 1000 containers will take the docker engine 100ms x 1000 = 100 s or nearly 2 minutes? Is there some reason why the docker engine is serial instead of parallel? How do people get around this?

解决方案

How do people get around this?

a/ They don't start 1000 containers at the same time b/ if they do, they might use a cluster management system like docker swarm to manage the all process c/ they do run 1000 containers, in advance in order to take into account the starting time.

Truly parallelize docker run command could be tricky considering some of those command might depend on other containers to be created/started first (like a docker run --volumes-from=xxx)

这篇关于Docker Engine可以并行启动容器吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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