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

13,695

Solution 1

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

Solution 2

#/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=
Share:
13,695
Martin Rauscher
Author by

Martin Rauscher

Updated on June 25, 2022

Comments

  • Martin Rauscher
    Martin Rauscher almost 2 years

    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?

  • Martin Rauscher
    Martin Rauscher over 8 years
    Thanks! So one could say that SystemD just overrides the ordinary Linux limits?
  • Cristian Rodriguez
    Cristian Rodriguez over 8 years
    Systemd is able to raise or decrease the system defaults, please see serverfault.com/questions/356962/… top comment for a longer more detailed explanation
  • Leifb
    Leifb almost 2 years
    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.