I normally use pam_limits.so and /etc/security/limits.conf to set ulimits on file size, CPU time, etc. for the regular users logging in to my server running Ubuntu. What is the best way of doing something similar with Solaris 10?

I think it is done using /etc/system, but I have no idea what to add to the file or indeed if it is the correct file. I'm particularly interested in setting up ulimit -f without going down the .profile route.


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.


It's also worth mentioning plimit. This can view or set limits on already running processes.

# plimit 7028
7028:   /usr/lib/gconfd-2 18
   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)  512             65536
  vmemory(kbytes)       unlimited       unlimited

it is possible to establish max file descriptors by setting ulimit in the .profile of the web server's owner to ulimit -s 32768

ulimit -n 32768 - is correct


This link has detailed info about how to use Solaris 10 "projects".

This PDF has all the parts in one file. The stuff relevant to this question is on page 59.


You may find this link interesting: Tuning the Operating System

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy