Under Leopard the initial process is launchd
. The default ulimits of each process are inherited from launchd
. For reference the default (compiled in) limits are
$ sudo launchctl limit
cpu unlimited unlimited
filesize unlimited unlimited
data 6291456 unlimited
stack 8388608 67104768
core 0 unlimited
rss unlimited unlimited
memlock unlimited unlimited
maxproc 266 532
maxfiles 256 unlimited
To change any of these limits, add a line (you may need to create the file first) to /etc/launchd.conf
, the arguments are the same as passed to the launchctl
command. For example
echo "limit maxfiles 1024 unlimited" | sudo tee -a /etc/launchd.conf
However launchd
has already started your login shell, so the simplest way to make these changes take effect is to restart our machine. (Use >> to append to /etc/launchd.conf.)
On Solaris you can set this parameter to be a hard or soft limit system-wide OR you can do the same for a specific application so that it has the correct number of open file descriptors in its run-time space.
To make it a system-wide change, edit /etc/system
with following entries
# Hard limit on file descriptors for single process
set rlim_fd_max = 4096
# Soft limit on the file descriptors for a single process
set rlim_fd_cur = 1024
NOTE: without setting rlim_fd_max
as shown above, the default value for file descriptors or nofiles is half of the rlim_fd_cur
value. So, it's best to set them both.
If you are using a Solaris project for an application space like Oracle Database, you can set the max file descriptors in the project by:
projadd -U oracle -K “process.max-file-descriptor=(priv,4096,deny)” user.oracle
Additionally, you can set it using ulimit
directly in an application's owner's shell startup file. For example, it is possible to establish max file descriptors by setting ulimit
in the .profile
of the web server's owner to ulimit -s 32768
and calling that from the startup/shutdown script.
As you can see there are lots of options and ways of doing this.
Best Answer
Modify
/etc/security/limits.conf
with what you need. Example:user soft nproc 64000
This line will set the number of processors (
-u
) to 64000 for "user". Soft/hard limits can be the same (soft allows spikes while hard prevents spawning).