Repository navigation
Conversation
|
@alexlarsson Do you remember why we went with the default of MS_PRIVATE instead of MS_SLAVE? |
As an admin I would expect that if I volume mount a partition into a container, and then later add a mount point to the volume, it will show up in the container. Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
0bdd630 to
842b849
Compare
|
Wasn't the whole point of making this private to avoid performance issues with propagating mounts into this namespace due to the kernel being shit? I'm not 100% sure here, but this may be causing a performance regression wrt that. |
|
There's an issue related to this performance problem: #2891 |
|
I think the issue was that if you have a 1000 containers running. Then when you start a new one it will create a new mount in the global namespace. This will propagate into all the running containers, as it may possibly be wanted there. However, in practice /var/docker is not available in those containers so the propagation is a no-op. However, the kernel code for this was pretty dumb, so it only noticed it was a no-op after a lot of work (O(n) in the number of mounts i think) had been done, and this for each sub-namespace. The end result was that to start a container we did O(n^2) work (n==number of running containers). So starting n new containers was O(n^3), and really slow. Marking the devicemapper mound directory private avoided the dumbness above by avoiding propagation early in the operation. However, I question the above patch. Yes, the root of the container is MS_PRIVATE, but that does not necessarily hold for a volume that has been bind-mounted into the container. That bind mount should be MS_SLAVE. |
|
I guess I have two questions, should we optimize for the 1000s of containers use case versus the common 10's of containers use case. Not having mount propogation into a container, is very confusing. |
|
@rhatdan There are certainly Docker users and Docker deployments out there which require thousands of containers. I know there are people who are having problems because of the 1024 ports limit for the default Linux bridge. |
|
@unclejack Understood, (openshift) for one. We need a mechanism to change the default behaviour preferable though the daemon or via docker run commands. |
|
@rhatdan I don't necessarily disagree, but I don't see how the /var/lib/docker/devicemapper directory being private has to do with the volumes not being propagated. Surely the volume bind-mounts themselves are mounted as slave, and it should not matter that the root of the container is private? |
|
I don't believe we do this now. What I was seeing even in a privileged container, was when I run docker run -ti -v /usr:/usr fedora /bin/sh mount --make-rslave /usrOutside container /usr/share would still not propagate. When I changed libcontainer to mount "/" SLAVE and the /var/lib/docker/devmapper to SLAVE, it worked. Propogation was failing with devmapper mounted SLAVE but libcontainer "/" mounted PRIVATE. It only worked when "/" was also mounted SLAVE. I have not tried again with with /var/lib/devmapper as PRIVATE. |
|
Can you try "/" as slave and devmapper as private? Having devmapper as private is what fixed the performance issue i think. |
|
Ok just tried an experiment with just the /var/lib/docker/devmapper mounted PRIVATE and it still worked. |
Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
|
We are cutting a build with this change and will have performance team check if there is any performance degradation. thanks @alexlarsson |
|
@rhatdan Any news from your performance team? |
|
They found no difference, I believe. @jerms can you confirm. |
|
ping what do we want to do with this? |
|
I think the libcontainer changes which got merged were all we needed. I will close this for now, and reopen if I find any problems. |
As an admin I would expect that if I volume mount a partition into a container, and then later add a mount point to the volume, it will show up in the container.
Docker-DCO-1.1-Signed-off-by: Dan Walsh [email protected] (github: rhatdan)