Can Docker Engine start containers in parallel

2019-04-07 14:53发布

问题:

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?

回答1:

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