Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm tuning the nofile value in /etc/security/limits.conf for my oracle user and I have a question about its behavior: does nofile limit the total number of files the user can have open for all of its processes or does it limit the total number of files the user can have open for each of its processes?

Specifically, for the following usage:

oracle                  hard    nofile                  65536
share|improve this question
up vote 10 down vote accepted

Most of the values¹ in limits.conf are limits that can be set with the ulimit shell command or the setrlimit system call. They are properties of a process. The limits apply independently for each process. In particular, each process can have up to nofile open files. There is no limit to the number of open files cumulated by the processes of a user.

The nproc limit is a bit of a special case, in that it does sum over all the processes of a user. Nonetheless, it still applies per-process: when a process calls fork to create a new process, the call is denied if the number of processes belonging to the process's euid is would be larger than the process's RLIMIT_NPROC value.

The limit.conf explains that the limits apply to a session. This means that all the processes in a session will all have these same limits (unless changed by one of these processes). It doesn't mean that any sum is done over the processes in a session (that's not even something that the operating system tracks — there is a notion of session, but it's finer-grained than that, for example each X11 application tends to end up in its own session). The way it works is that the login process sets itself some limits, and they are inherited by all child processes.

¹ The exceptions are maxlogins, maxsyslogins and chroot, which are applied as part of the login process to deny or influence login.

share|improve this answer
Conversely, does that mean different sessions can have different sets of limits? – CMCDragonkai Aug 16 '15 at 7:21
@CMCDragonkai Yes, for example if limit.conf changed between the times the sessions were open, or if different limits (they'd have to be smaller except for root) are set in .profile. – Gilles Aug 16 '15 at 8:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.