cancel
Showing results for 
Search instead for 
Did you mean: 

ulimit options in plain English

SOLVED
Go to solution
Maaz
Valued Contributor

ulimit options in plain English

ulimit
-c The maximum size of core files created
-m The maximum resident set size
-n The maximum number of open file descriptors (most systems do not allow this value to be set)

I want to understand the above ulimit options in plain English, esp the last one (-n)

the IBM domino server, runs via an ordinary user 'notes', so before become 'notes'
# ulimit -n 40000
# su - notes
and then run the domino server.

Ok, one more thing
# ulimit -n
1024

while

# cat /proc/sys/fs/file-max
205044

why the difference ? which one is wrong ?


Regards
Maaz
2 REPLIES
Basheer_2
Trusted Contributor

Re: ulimit options in plain English

During our oracle install in Red Hat. this is the way I set up for oracle user

To make these changes, run the following as root:

cat >> /etc/security/limits.conf <oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF

cat >> /etc/pam.d/login <session required /lib/security/pam_limits.so
EOF

Update the default shell startup file for the "oracle" UNIX account.

* For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file by running the following command:

cat >> /etc/profile < if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF


Heironimus
Honored Contributor
Solution

Re: ulimit options in plain English

ulimit and /etc/security/limits.conf control per-session limits. The things under /proc are mostly system-wide limits.

-c is the maximum size for core dumps. The most common settings I've seen are "0" to disable core dumps and "unlimited" because truncated core dumps are probably not useful.

-m is a limit on resident memory size, but I'm not sure if that specific ulimit is honored on Linux or if the option is just there for compatibility.

-n is a limit on open file descriptors. Open files, network connections, and some IPCs all use file descriptors.

Off the top of my head I don't remember if -m and -n set the limits for each process or for the entire session, but most proper UNIX daemons end up with their own sessions anyway.