I want to increase the ulimit -n value,so I add

*       soft  nofile  20000
*       hard  nofile  20000

in the /etc/security/limits.conf file, but there is a question confuse me all the time.
what level is the value ulimit -n mean? user level or process level?
Specifically speaking, if the value of ulimit -n is 512, and user testUser hava 3 process, does it means testUser can have the total file descriptors for 512 sum up for all his 3 process, or does it means each of testUser's process can have 512 file descriptors and thus testUser can hava a total file descriptors amount of 512*3?


1 Answer 1


The behaviour changes depend on if its a systemd service or not which i am not capable of pointing differences.

/etc/security/limits.conf file sets the limits for root user, if you would like to increase a user's limits, you should edit /etc/security/limits.d/testUser.conf file.

  • And what is the level of ulimit -n control ? user or process?thanks
    – jacky
    Dec 3, 2018 at 8:33
  • -n The maximum number of open file descriptors. file descriptor: In Unix and related computer operating systems, a file descriptor (FD, less frequently fildes) is an abstract indicator (handle) used to access a file or other input/output resource, such as a pipe or network socket.
    – e73kiel
    Dec 3, 2018 at 8:52
  • And as the example I mention in the question, if testUser have 3 process, what is the max file descriptor amount can testUser get? 512 or 512*3?
    – jacky
    Dec 3, 2018 at 8:57
  • Are limits.conf values applied on a per-process basis?,this answer seems have the opposite point of view
    – jacky
    Dec 3, 2018 at 15:46
  • Man page linux.die.net/man/5/limits.conf says The pam_limits.so module applies ulimit limits, nice priority and number of simultaneous login sessions limit to user login sessions.
    – e73kiel
    Dec 4, 2018 at 8:13

Not the answer you're looking for? Browse other questions tagged .