Docker Community Forums

Share and learn in the Docker community.

Large startup time for docker containers due to network?

docker

(Anupmohan) #1

Hi

When multiple containers are launched simultaneously, the startup time for containers increases with the number of containers being launched. For example, if I try to launch 70 containers, it takes ~20 seconds for all containers to be running. After some performance debugging using pprof and perf, it was observed that docker spends majority its time connecting each container to the network (possibly spinning on iptable lock). If I disable the network (–network=none), the startup time for 70 containers is ~8 seconds.

Is this an expected behavior? Does docker not scale well due to network bottleneck? Is there a workaround?

OS Version: Ubuntu 16.04.1 LTS
Docker version: Docker version 17.07.0-dev, build

Steps to reproduce:

  1. Save the current time
  2. Start 70 containers simultaneously (container need not do any operation)
  3. Measure the startup time for each container using the docker inspect command and the saved time
  4. Repeat the steps by setting the network to “none” (–network=none)

Thanks
Anup


(Harshadsane1) #2

I am observing the same issue. With multiple containers the start up time grows exponentially when started with a network. Anyone have a solution or possible reason?


(Ijiji89) #3

Hi, did you find any proper solution, facing same issue.


(Emma Watson) #4

Thanks it is valuable and it is very nice that you have posted the solution. Much Appreciated and keep up the good work.