Tuesday, April 7, 2009

Understanding Open file limit in Solaris 10/ Open solaris

Shell level changes

To specify the file limit use

ulimit -n &lt no of files&gt

To see the changes made

ulimit -a

These limits are set and controlled by the user's shell to limit the system resources consumed by the current shell process and all it's descendants.

System level changes

To make the changes persistent across the whole machine, you'd need to tune the following settings in /etc/system

/etc/system:

rlim_fd_max
Description: "Hard" limit on file descriptors that a single process might have to open.
Minimum: 1
Maximum: MAXINT
Default: 65,536

rlim_fd_cur
Description: "Soft" limit on file descriptors that a single process can
have open.
Minimum: 1
Maximum: MAXINT
Default: 256

save and exit
reboot

Note that these settings are per process.

The plimit command can be used to find out the limitations imposed on a particular process. e.g.
plimit 1556
1556: /usr/apache2/2.2/bin/httpd -f /etc/vpanels/httpd.conf -DSSL -k start
resource current maximum
time(seconds) unlimited unlimited
file(blocks) unlimited unlimited
data(kbytes) unlimited unlimited
stack(kbytes) 10240 unlimited
coredump(blocks) unlimited unlimited
nofiles(descriptors) 65536 65536
vmemory(kbytes) unlimited unlimited