Resource limits is the concept where you regulate several resources consumed by a process on an UNIX operating systems. Although the resource limits are set on a per user basis, they are applied per process basis. Therefore, if a user is executing hundreds of processes, the user may consume huge amount of resources, even if the resource setting values for the user are relatively small numbers.
On UNIX systems, the ulimit command controls the limits on system resource, such as process data size, process virtual memory, and process file size. Specifically:
To display the current user’s resource limits, use the ulimit command (see the following example):
-S option instructs the command to display soft resource limits.
The hard resource limit values are set by the root user using the chuser command for each user. The soft resource limit values can be relaxed by the individual user using the ulimit command, as long as the values are smaller than the hard resource limit values.
At minimum, set these size limits to 256 MB, which is the value of 256000 in the /etc/security/limits file. Increase these limits when a larger-than-default IBM Directory server cache is to be used. For more information, see the IBM Directory Server documentation.
In addition to the /etc/security/limits file, the process virtual memory size is limited by the number of segments that a process can use. By default, a process can only use one memory segment, which limits a process to 128 MB. AIX support a large memory model that is enabled through the LDR_CNTRL environment variable.
On UNIX systems, the ulimit command controls the limits on system resource, such as process data size, process virtual memory, and process file size. Specifically:
- On Solaris systems, by default, the root user has unlimited access to these resources (for example, unlimited).
- On AIX, some limits might apply to the root user.
To display the current user’s resource limits, use the ulimit command (see the following example):
# ulimit -Ha time(seconds) unlimited file(blocks) 2097151 data(kbytes) unlimited stack(kbytes) unlimited memory(kbytes) unlimited coredump(blocks) unlimited nofiles(descriptors) unlimited # ulimit -Sa time(seconds) unlimited file(blocks) 2097151 data(kbytes) 131072 stack(kbytes) 32768 memory(kbytes) 32768 coredump(blocks) 2097151 nofiles(descriptors) 2000-H option instructs the command to display hard resource limits.
-S option instructs the command to display soft resource limits.
The hard resource limit values are set by the root user using the chuser command for each user. The soft resource limit values can be relaxed by the individual user using the ulimit command, as long as the values are smaller than the hard resource limit values.
Increasing process memory size limit
Enter the following command to check the current process data size and virtual memory size limits:ulimit -d ulimit -mIt is recommended that the process data size and virtual memory size be set to unlimited. Setting to unlimited can be done by modifying the following lines in the /etc/security/limits file:
default: data = -1 rss = -1For changes to the /etc/security/limits file to take effect, the user must log out of the current login session and log back in.
At minimum, set these size limits to 256 MB, which is the value of 256000 in the /etc/security/limits file. Increase these limits when a larger-than-default IBM Directory server cache is to be used. For more information, see the IBM Directory Server documentation.
In addition to the /etc/security/limits file, the process virtual memory size is limited by the number of segments that a process can use. By default, a process can only use one memory segment, which limits a process to 128 MB. AIX support a large memory model that is enabled through the LDR_CNTRL environment variable.
Increase file size limit
Enter the following command to check the current file size limits:ulimit -fIt is recommended that the file size limit be set to unlimited. Setting to unlimited can be done by modifying the following lines in the /etc/security/limits file:
default: fsize = -1
Create file systems with large file support
The standard file system on AIX has a 2 GB file size limit, regardless of the ulimit setting. One way to enable files larger than the 2 GB limit is to create the file system with the Large File Enabled option. This option can be found through the Add a Journaled File System option of the smit menu. Refer to AIX documentation for additional information and file system options.Edit/Change the Ulimit Values for uid:
- Edit the limits file under /etc/security/limits (takes effect after reboot)
- Use the chuser command to change individual user settings (logout and login required)
Here are a few of the flags that can be set:
chuser rss=-1 username
chuser fsize=-1 username
chuser data=-1 username
chuser nofiles=4000 username
chuser “stack=8388608? username
chuser fsize=-1 username
chuser data=-1 username
chuser nofiles=4000 username
chuser “stack=8388608? username
0 blogger-disqus:
Post a Comment