What is SystemD's default value for LimitNOFILE (on CentOS7)
Asked Answered
G

3

8

It seems like a very easy question but I couldn't find, what the default for services in SystemD for LimitNOFILE is.

Is there a file with global defaults?

Garret answered 17/12, 2015 at 19:19 Comment(0)
S
3

systemd imposes no such limit by default. however pam_limits generally does, configuration file is /etc/security/limits.conf

Smacker answered 18/12, 2015 at 2:8 Comment(4)
Thanks! So one could say that SystemD just overrides the ordinary Linux limits?Garret
Systemd is able to raise or decrease the system defaults, please see serverfault.com/questions/356962/… top comment for a longer more detailed explanationSmacker
For us, systemd did impose this limit (ubuntu 18.04 and 20.04). We had all of our servers crash and changing LimitNOFILE to a high value did fix the problem. Limits in /etc/security/limits.conf were set high enough and increasing it alone did not fix the problem. Maybe it has been changed since 2015.Pratincole
it appears /etc/systemd/system.conf now does apply a limit (see the other answer)Chromatin
B
6
#/etc/security/limits.conf
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
#if your program startup via systemctl
#config /etc/systemd/system.conf
DefaultLimitNOFILE=
Besse answered 8/8, 2016 at 12:8 Comment(0)
S
3

systemd imposes no such limit by default. however pam_limits generally does, configuration file is /etc/security/limits.conf

Smacker answered 18/12, 2015 at 2:8 Comment(4)
Thanks! So one could say that SystemD just overrides the ordinary Linux limits?Garret
Systemd is able to raise or decrease the system defaults, please see serverfault.com/questions/356962/… top comment for a longer more detailed explanationSmacker
For us, systemd did impose this limit (ubuntu 18.04 and 20.04). We had all of our servers crash and changing LimitNOFILE to a high value did fix the problem. Limits in /etc/security/limits.conf were set high enough and increasing it alone did not fix the problem. Maybe it has been changed since 2015.Pratincole
it appears /etc/systemd/system.conf now does apply a limit (see the other answer)Chromatin
C
3

The default config is in /etc/systemd/system.conf, and the default value is DefaultLimitNOFILE=1024:524288.

Cyclopean answered 9/11, 2021 at 2:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.