User System Resource Limits

About This Document

This document applies to AIX Versions 3.2 through 4.3.

Prerequisite Information

There are two types of user limits: hard limits and soft limits.

The actual concept of "hard limits" was introduced in AIX 4.1. AIX 3.2 has a fixed upper boundary that cannot be exceeded. The hard limits are generally set by the system administrator as a maximum limitation on a user's processes. These limits can only be raised by a member of the security group; however, a user can lower this value. Any changes made by the user will be lost upon logout.

You can view your hard limits using:

 
   ulimit -Ha 

The soft limits are the values directly used by the kernel to limit a process's system resources. The soft limits can be changed by anyone, but cannot exceed the value set for the hard limit. Only a member of the security group can make permanent changes to these limits. Any changes made by the user will be lost upon logout.

You can view your soft limits using:

 
   ulimit -a 

The following are the default soft limits:

 
   3.2                 4.1-4.3 
   ===============     ================= 
   fsize = 2097151     fsize = 2097151 
   core = 2048         core = 2048 
   cpu = 3600          cpu = -1 
   data = 131072       data = 262144 
   rss = 65536         rss = 65536 
   stack = 8192        stack = 65536 
   nofiles = 2000 * 

* This value can only be changed in AIX 4.3.1 or later.

Note: A negative value denotes "unlimited."

These values are used as default settings when a new user is added to the system, and are stored in the /etc/security/limits file.

Explanations of the Limits

Most of the following information is from the setrlimit() and getrlimit() man pages.

File Size

 
   FSIZE = 2097151     (units in 512-byte blocks) 
 
   HARD_FSIZE = -1     (unlimited) 

This value is a limit that the kernel will enforce on a user process. This means a user cannot write to a file larger than the limit. This value can be lowered by the user, but only root user can raise this value.

The largest number the limit can be set to is 4194303 512-byte blocks, or 2 GIG. In AIX 4.2.1 the maximum file size was increased to 64 GIG. The number above still applies, but the term "unlimited", a value of "-1", should be used in cases where you want to create files larger than 2 GIG in size.

To change the soft limit using the chuser command execute:

 
   chuser fsize=<value> <username> 

To change the hard limit using the chuser command execute:

 
   chuser hard_fsize=<value> <username> 

To change your current soft limit use, execute;

 
   ulimit -f value 

Core File Size

 
   CORE = 2048         (units in 512-byte blocks) 
 
   HARD_CORE = -1 

This limit is enforced by the kernel and it will not allow a user to create a core file larger than the set SOFT limit.

To change the soft limit using the chuser command execute:

 
   chuser core=<value> <username> 

To change the hard limit using the chuser command execute:

 
   chuser hard_core=<value> <username> 

To change your current soft limit use, execute:

 
   ulimit -c <value> 

CPU Time

 
   CPU = 3600              (units in seconds) 
 
   HARD_CPU = -1 

This limit can be lowered by the user, but only a root user may raise this value. This limit is not enforced by the kernel. This value may be checked by application code or user code, but the kernel will not enforce this value. In other words, if a process passes its SOFT CPU time limit, the kernel will NOT send a SIGXCPU signal to the offending process. The kernel will let processes run as long as they are able. So this value can be misleading.

To change the soft limit using the chuser command execute:

 
   chuser cpu=<value> <username> 

To change the hard limit using the chuser command execute:

 
   chuser hard_cpu=<value> <username> 

To change your current soft limit use, execute:

 
   ulimit -t <value> 

Data Segment

 
   DATA = 131072 (units in 512-byte blocks in 
                 /etc/security/limits and kbytes in ulimit) 
 
   HARD_DATA = -1 

This limit defines the maximum size, in bytes, of the data segment for a process; this defines how far a program may extend its "break" value. This limit is enforced by the kernel.

Data and stack are tied together. They exist in Segment 2, and together they can never be greater than approximately 256 Mb. This value is actually larger, but 256 Mb is a good number to use.

The user can raise their Hard and Soft data or stack values with the ulimit command. The kernel will not let the MAXs overlap.

With DATA, you might have to lower your STACK value to be able to raise your DATA limit. There is a possiblity that users could kill themselves by lowering their STACK limit lower than what they have already allocated on the stack and then trying to use it, getting a SIGSEGV.

To change the soft limit using the chuser command execute:

 
   chuser data=<value> <username> 

To change the hard limit using the chuser command execute:

 
   chuser hard_data=<value> <username> 

To change your current soft limit use, execute:

 
   ulimit -d <value> 

Stack Segment

 
   STACK = 8192        (units in 512-byte blocks in 
                       /etc/security/limits and kbytes in ulimit) 
 
   HARD_STACK = -1 

This limit defines the maximum size, in bytes, of the stack segment for a process. This defines how far a program's stack segment may be extended.

A process can access its stack only up to the SOFT limit.

To change the soft limit using the chuser command execute:

 
   chuser limit=<value> <username> 

To change the hard limit using the chuser command execute:

 
   chuser hard_limit=<value> <username> 

To change your current soft limit use, execute:

 
   ulimit -s <value> 

Resident Set Size

 
   RSS = 65536         (units in 512-byte blocks in 
                       /etc/security/limits and kbytes in ulimit) 
 
   HARD_RSS = -1 

This limit defines the maximum size, in bytes, to which a process's resident set size may grow.

This limit is NOT enforced by the kernel. The kernel will not check this value for a process. It will let the process use as much memory as it needs to run with, and it will not kill a process if it reaches its SOFT limit. The kernel will only start killing processes if system-wide paging space gets very low, and that's after it has sent a SIGDANGER signal (init will catch this signal and send a warning message to the console). This happens when the system only has about 2 Mb of free paging space, and soon after this it will start killing the youngest process utilizing virtual memory.

To change the soft limit using the chuser command execute:

 
   chuser rss=<value> <username> 

To change the hard limit using the chuser command execute:

 
   chuser hard_rss=<value> <username> 

To change your current soft limit use, execute:

 
   ulimit -m <value> 

Number of Open Files

 
   NOFILES = 2000 
 
   HARD_NOFILES = -1 

Note: In all versions prior to AIX 4.3.1, this number was fixed at 2000.

This limit is enforced by the kernel. This means that a single process cannot have more files descriptors at one time than specified by this limit. The maximum value for this limit is 32767.

To change the soft limit using the chuser command execute:

 
   chuser nofiles=<value> <username> 

To change the hard limit using the chuser command execute:

 
   chuser hard_nofiles=<value> <username> 

To change your current soft limit use, execute:

 
   ulimit -n <value> 

User System Resource Limits: limits.all.cmd ITEM: FAX
Dated: 98/09/02~00:00 Category: cmd
This HTML file was generated 99/06/24~12:42:08
Comments or suggestions?
Contact us