Skip to content

bump container limit via systemd conf file#4455

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

bump container limit via systemd conf file#4455
tianon merged 1 commit intomoby:masterfrom
lsm5:systemd

Conversation

@lsm5
Copy link
Contributor

@lsm5 lsm5 commented Mar 4, 2014

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar [email protected] (github: lsm5)

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

@tianon
Copy link
Member

tianon commented Mar 4, 2014

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
Copy link
Member

tianon commented Mar 4, 2014

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
Copy link
Contributor Author

lsm5 commented Mar 4, 2014

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

@tianon
Copy link
Member

tianon commented Mar 4, 2014

Good to know :)

@lsm5
Copy link
Contributor Author

lsm5 commented Mar 4, 2014

@tianon so latest version works

Max processes 1048576 1048576 processes
Max open files 1048576 1048576 files

@tianon
Copy link
Member

tianon commented Mar 4, 2014

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
Copy link
Contributor Author

lsm5 commented Mar 4, 2014

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
Copy link
Member

tianon commented Mar 4, 2014

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

@tianon
Copy link
Member

tianon commented Mar 4, 2014

@tianon
Copy link
Member

tianon commented Mar 4, 2014

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

/devilsadvocate

@lsm5
Copy link
Contributor Author

lsm5 commented Mar 4, 2014

umm, container bombs? ;)

@tianon
Copy link
Member

tianon commented Mar 4, 2014

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

@lsm5
Copy link
Contributor Author

lsm5 commented Mar 4, 2014

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

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
Copy link
Contributor Author

lsm5 commented Mar 4, 2014

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

@tianon
Copy link
Member

tianon commented Mar 5, 2014

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

@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
Copy link
Member

tianon commented Mar 5, 2014

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
Copy link
Contributor Author

lsm5 commented Mar 5, 2014

@jeremyeder yup that was the intent

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

Docker-DCO-1.1-Signed-off-by: Lokesh Mandvekar <[email protected]> (github: lsm5)

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

philips commented Mar 5, 2014

lgtm

@philips
Copy link
Contributor

philips commented Mar 5, 2014

@tianon welcome ;)

@tianon
Copy link
Member

tianon commented Mar 5, 2014

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
Copy link
Member

tianon commented Mar 5, 2014

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
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