ulimit

Hi,

I need to increase the open files on my server to run a test. Usually what I do is:

ulimit 杗 5000

My questions are:

1] I want to set this parameter once and for all. What is the right parameter to set in /etc/system: rlim_fd_max or rlim_fd_cur?

2] How to make sure that this parameter won抰 make the system unstable?

3] What is the difference between 搖limit 朼?and 搖limit -a 朒? Each one gives a different 搊pen files?value.

thanks a lot.

[487 byte] By [Linda_Ba] at [2007-11-27 1:34:44]
# 1

I had a similar issue, here are some notes:

The kernel establishes default hard and soft limits for the number of files a process can have opend at any one time. rlim_fd_max is the hard limit, and rlim_fd_cur is the current limit (or soft limit). A process can have up to rlim_fd_cur file descriptors and can increase the number up to rlim_fd_max. You can set these parameters systemwide by placing

entries in the /etc/system file:

set rlim_fd_max=8192

set rlim_fd_cur=256

default limitdefault hard limitmax for stdio*^*max for select*^*

Solaris 9 (64-bit)2566553525665535

The soft limit (default limit) has to remain lower or equal to the hard

limit.

You can check the default (soft) limit and hard limit values via ulimit:

ulimit -a (soft)

ulimit -Ha (hard)

To tune it via /etc/system for the entire system (a regular reboot is necessary):

set rlim_fd_cur=<nofiles>

set rlim_fd_max=<nofiles>

To tune it via ulimit/limit (no reboot):

sh

ulimit -n <nofiles>

ksh

ulimit -n <nofiles>

csh

limit descriptors <nofiles>

ulimit/limit will change the default value for the shell therefore all the processes started in this shell will inherit the value. To change the limit for all the processes started by a specific user or by all the users, one can set "ulimit -n" in the environment file (e.g: /etc/profile, $HOME/.profile, etc...)

I have set these (/etc/system) as follows:

set rlim_fd_max=65535

set rlim_fd_cur=65535

The issues related to a requirement for file descriptor values less than 256 are not an issue with Solaris 9

You may want to wait until Darren or somebody a little more knowledgeable replies.

farmboya at 2007-7-12 0:42:24 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2
Looks pretty comprehensive to me! :-)-- Darren
Darren_Dunhama at 2007-7-12 0:42:24 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...