Examining and Changing Resource Limits

Restriction: This topic applies only when the Enterprise Server feature is enabled.

The system-wide default and maximum values for resource limits depend on UNIX platform and configuration. For more information consult your operating system documentation.

Resource limits can be set for individual processes and the processes they start. For example, if you start an enterprise server from the Enterprise Server Administration Console, it will inherit its resource limits from the Directory Server process mfds32 (which provides the Administration Web interface). Changes to the resource limits when starting the Directory Server will also affect enterprise server processes that are started through the Web interface. If you start an enterprise server from the command line using the casstart command, on the other hand, you can set resource limits in the current shell before running casstart to control resources for that enterprise server.

Resource limits can be examined and changed for the current shell using the UNIX ulimit utility. The exact syntax and output of the ulimit command depends on UNIX version, so consult your documentation for the specific details. Typically, however, ulimit -a displays all the current resource limit settings, as follows:

$ ulimit -a
time(seconds)        unlimited
file(blocks)         2097151
data(kbytes)         131072
stack(kbytes)        32768
memory(kbytes)       32768
coredump(blocks)     2097151
nofiles(descriptors) 2000

This is the output from an AIX 5.2 system. It shows that there is no CPU time limit in effect for processes started in this shell and that regular files and core dump files are limited to 2097151 512-byte blocks (1 GB in total). The data, stack, and memory limits are all limitations on how much memory the process can use. For enterprise server, the stack setting limits how many threads mfcs32 can create to handle conversations, and the data setting limits how much virtual memory mfcs32 can allocate to process conversations. The memory setting controls how much physical memory - RAM - a process can use, and is usually less important for enterprise server. The final limit is the number of file descriptors. mfcs32 requires a few descriptors for various purposes such as its log file, plus one for each listener; the rest are for individual conversations with clients. In this example, mfcs32 would be limited to something less than 2000 clients connected simultaneously.

There are two kinds of resource limits set by the ulimit command: hard and soft. By default, ulimit shows and sets soft limits. The soft limits are the ones that actually affect processes; hard limits are the maximum values for soft limits. Any user or process can raise the soft limits up to the value of the hard limits. Only processes with superuser authority can raise the hard limits.

For example, if you were encountering a resource limit problem with an Enterprise Server, and you wanted to raise the stack limit to see if that corrected the problem, you might try the following:

  1. Display the current soft limit for stack:
    $ ulimit -s
       32768
  2. Display the current hard limit (maximum) for stack:
    $ ulimit -H -s
       4194304
  3. Set the stack soft limit to some value between the current and the maximum:
    $ ulimit -s 65536
  4. Start the enterprise server with the new stack limit in effect:
    $ casstart

Note that in step 4 you start the enterprise server from the command line. If you wanted to start the enterprise server from the Administration Web interface, you would have to start the Directory Server from the command line in this shell, after raising the limit, and then start the enterprise server from it.