Skip to content

Remount /var/lib/docker as --private to fix scaling issue#4884

Merged
vieux merged 1 commit intomoby:masterfrom
rhatdan:remount-var-lib-docker
Mar 29, 2014
Merged

Remount /var/lib/docker as --private to fix scaling issue#4884
vieux merged 1 commit intomoby:masterfrom
rhatdan:remount-var-lib-docker

Conversation

@rhatdan
Copy link
Copy Markdown
Contributor

@rhatdan rhatdan commented Mar 27, 2014

If an admin mounts all file systems as -rshared (Default on RHEL and Fedora)
we see a scaling problem as the number of container increase.

Basically every new container needs to have it new mounts in /var/lib/docker
shared to all other containers, this ends up with us only able to scale to
around 100 containers, before the system slows down.

By simply bind mounting /var/lib/docker on its and then setting it private,
the scaling issue goes away.

Docker-DCO-1.1-Signed-off-by: Dan Walsh dwalsh@redhat.com (github: rhatdan)

@crosbymichael
Copy link
Copy Markdown
Contributor

This should probably be moved into runtime/runtime.go.NewRuntimeFromDirectory

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Mar 27, 2014

I agree with @crosbymichael

If an admin mounts all file systems as -rshared (Default on RHEL and Fedora)
we see a scaling problem as the number of container increase.

Basically every new container needs to have it new mounts in /var/lib/docker
shared to all other containers, this ends up with us only able to scale to
around 100 containers, before the system slows down.

By simply bind mounting /var/lib/docker on its and then setting it private,
the scaling issue goes away.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Mar 28, 2014

Moved to runtime/runtime.go.NewRuntimeFromDirectory and now using config.Root.

@unclejack
Copy link
Copy Markdown
Contributor

LGTM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be inside the if block for !mounted ?

@rhatdan
Copy link
Copy Markdown
Contributor Author

rhatdan commented Mar 28, 2014

No. It is checking to see if /var/lib/docker is a mountpoint, if it is not, it will bind mount it on top of itself, making it a mount point. Then it sets the mountpoint to "private" meaning changes to /var/lib/docker mount points will not be seen in other namespaces.

@crosbymichael
Copy link
Copy Markdown
Contributor

LGTM

@crosbymichael
Copy link
Copy Markdown
Contributor

@vieux do you care yo try this PR on your aufs system?

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Mar 28, 2014

LGTM

vieux added a commit that referenced this pull request Mar 29, 2014
Remount /var/lib/docker as --private to fix scaling issue
@vieux vieux merged commit c705e4a into moby:master Mar 29, 2014
@rhatdan rhatdan deleted the remount-var-lib-docker branch March 30, 2014 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants