Skip to content

bump container limit via systemd conf file - #4455

Merged
tianon merged 1 commit into
moby:masterfrom
lsm5:systemd
Mar 5, 2014
Merged

tianon merged 1 commit into
moby:masterfrom
lsm5:systemd

Conversation

@lsm5

@lsm5 lsm5 commented Mar 4, 2014

Copy link
Copy Markdown
Contributor

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar lsm5@redhat.com (github: lsm5)

new file:   contrib/init/systemd/docker.service.d/docker.conf

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

Can you tell me a little bit about this file, or give me a link I can chew on to understand where it should be installed? :)

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

Also, if it goes into a "docker.service.d" directory (like it appears to), wouldn't it make more sense to name it "limits.conf" ?

@lsm5

lsm5 commented Mar 4, 2014

Copy link
Copy Markdown
Contributor Author

sorry .. haven't tested this yet, sent it out too soon :\

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

Good to know :)

@lsm5

lsm5 commented Mar 4, 2014

Copy link
Copy Markdown
Contributor Author

@tianon so latest version works

Max processes 1048576 1048576 processes
Max open files 1048576 1048576 files

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

So how about some information about where and how to use this? :) Is there somewhere in /usr/lib/systemd this can be installed by packagers, or is this meant for users to put into /etc/systemd?

@lsm5

lsm5 commented Mar 4, 2014

Copy link
Copy Markdown
Contributor Author

whoops sorry ..(speaking with fedora as reference) there's /usr/lib/systemd/system/docker.service installed via rpm. This new addition would also be in the same dir as docker.service (so /usr/lib/systemd/system/docker.service.d/limits.conf)

to see the difference, just add this and then do

systemctl daemon-reload
systemctl restart docker
cat /proc/`pidof docker`/limits

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

Perfect, thanks. That's exactly the information I was hoping for. 👍

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

So, why not just use "infinity", if we're going insanely high anyways? :)

/devilsadvocate

@lsm5

lsm5 commented Mar 4, 2014

Copy link
Copy Markdown
Contributor Author

umm, container bombs? ;)

@tianon

tianon commented Mar 4, 2014

Copy link
Copy Markdown
Member

Fair enough, but won't those take out the host anyways? Especially with such a high limit?

@lsm5

lsm5 commented Mar 4, 2014

Copy link
Copy Markdown
Contributor Author

i was given that number by a perf eng guy, so I'd say that's a tested limit, but if you'd prefer to wait until further info/confirmation

@jeremyeder

Copy link
Copy Markdown

Hi folks, I'm the perf eng guy.

According to http://www.freedesktop.org/software/systemd/man/systemd.unit.html#Unit%20Load%20Path

We should drop the override here:
/etc/systemd/system/docker.service.d/limits.conf

Hi @tianon there's nothing special about 1048576. In fact it's higher than is actually necessary (at the moment). It is however what we've tested with, and as @lsm5 mentioned, we haven't hit any issues with these 2 particular limit changes.

Regarding other LimitXYZ knobs for systemd like LimitCPU: right now we are trying to identify the smallest set of changes that are needed for scaling vertically. No shotgun approach, just the minimum, technically verified set.

We'll send RFC mail or patches if we need/recommend other knobs, as we did for this:
https://groups.google.com/forum/#!msg/docker-user/k5hqpNg8gwQ/-00mvrB2nIkJ

@lsm5

lsm5 commented Mar 4, 2014

Copy link
Copy Markdown
Contributor Author

aah my bad on the override install location, sorry about that

@tianon

tianon commented Mar 5, 2014

Copy link
Copy Markdown
Member

Ah, so this is something that shouldn't be installed by the package, but should be installed by users if they want it?

@jeremyeder

Copy link
Copy Markdown

@lsm5 can correct me if I'm wrong about the implementation, but AIUI, the intent is to have this systemd unit file override exist in the upstream repo (for anyone's use), then our packaging will take care of actually enabling it in the distribution.

@tianon

tianon commented Mar 5, 2014

Copy link
Copy Markdown
Member

In that case it sounds like it ought to be added to "docker.service" directly, and then overridden by users in "/etc/systemd/system/docker.service.d/limits.conf", like the other bits of "docker.service", but I could certainly be wrong.

As an example, "radvd.service" from Gentoo: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-misc/radvd/files/radvd.service (which sets "LimitNOFSIZE" and "CPUSchedulingPolicy").

@lsm5

lsm5 commented Mar 5, 2014

Copy link
Copy Markdown
Contributor Author

@jeremyeder yup that was the intent

@tianon yup this works ... i'll update this PR

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com> (github: lsm5)

	modified:   contrib/init/systemd/docker.service
	modified:   contrib/init/systemd/socket-activation/docker.service
@philips

philips commented Mar 5, 2014

Copy link
Copy Markdown
Contributor

lgtm

@philips

philips commented Mar 5, 2014

Copy link
Copy Markdown
Contributor

@tianon welcome ;)

@tianon

tianon commented Mar 5, 2014

Copy link
Copy Markdown
Member

Thanks @lsm5, LGTM

Thanks for looking it over too, @philips :D

tianon added a commit that referenced this pull request Mar 5, 2014
Bump container limit via systemd conf file
@tianon
tianon merged commit 6f25643 into moby:master Mar 5, 2014
@tianon

tianon commented Mar 5, 2014

Copy link
Copy Markdown
Member

Now we've got to figure out how to add the same limit in the other init files in a clean way that's just as easy for users to override, but that's a completely orthogonal issue. :)

@unclejack

Copy link
Copy Markdown
Contributor

This is still an issue for the sysvinit script.

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.

5 participants