Kbase 18910: Process Resource Limit and How to Check/Modify on UNIX
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  21/08/2003 |
|
Status: Technically Reviewed
GOAL:
How to check or modify the process resource limits on UNIX.
FACT(s) (Environment):
UNIX
FIX:
Following are settable resource limits in csh and ksh
Resource Keyword
csh ksh
---------------------------------------------------------------------
Total accumulated CPU time (hrs:mins:secs) cputime time
Large file that may be created filesize file
Max size of the data segment of the process datasize data
Max size of stack segment if the process stacksize stack
Max size of a core file coredumpsize coredump
Max amount of memory that may be used by memoryuse memory
the process
Resource limits are of two types: soft and hard. Soft limits are limits
currently applied by default when a new process is created. A user may
increase these values up to the system-wide hard limits. Hard limits
are absolute ceilings on resouce use, they are usually hard-wired into
the kernel and can not be changed by even the system admin.
In csh, the following commands can be used to display and set resouce
limits.
To display soft limits:
tsibm1(mswank)4: limit
cputime unlimited
filesize 1048575 kbytes
datasize 131072 kbytes
stacksize 32768 kbytes
coredumpsize 1048575 kbytes
memoryuse 32768 kbytes
To display hard limits:
tsibm1(mswank)2: limit -h
cputime unlimited
filesize 1048575 kbytes
datasize unlimited
stacksize unlimited
coredumpsize unlimited
memoryuse unlimited
To raise soft limits to hard limits:
unlimit
In sh and ksh, the following commands can be used to display and set resouce limits.
To display soft limits:
$ ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000
To display hard limits:
$ ulimit -Ha
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) unlimited
stack(kbytes) unlimited
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) unlimited
Each individual resource limit can be increased by specifying an
option corresponding to the first letter of its name. For example,
$ulimit -f 2097151
Please note, system administrators are not able to change most of
the hard limits, but they can always rebuild the kernel whenever adjusting operating system's resource settings is needed.