Pages

Thursday, April 6, 2017

Ulimit

ulimit provides control over the resources available to the shell and to processes started by it, on systems that allow such control.

conf file - /etc/security/limits.conf
/etc/security/limits.d/90-nproc.conf


An unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit, and (irreversibly) lower its hard limit. A privileged process can make arbitrary changes to either limit value.
If limit is given, it is the new value of the specified resource. Otherwise, the current value of the soft limit for the specified resource is printed, unless the `-H' option is supplied.
When setting new limits, if neither `-H' nor `-S' is supplied, both the hard and soft limits are set.
Restricting per user processes ( -u) can be useful for limiting the potential effects of a fork bomb.
Values are in 1024-byte increments, except for `-t', which is in seconds, `-p', which is in units of 512-byte blocks, and `-n' and `-u', which are unscaled values.

ulimit value set through command line is not persistent. Reboot will revert to default. for permanent changes do the change in /etc/security/limits.conf

test            soft     nproc           3000
max user processes              (-u) 3000

The return status is zero unless an invalid option is supplied, a non-numeric argument other than unlimited is supplied as a limit, or an error occurs while setting a new limit.
ulimit is a bash built in command.
ulimit -a
ulimit -a -H
ulimit -a -S
ulimit -u -S
ulimit -u -H

powerce  hard   nofile   16000
powerce  soft   nofile   16000

# Oracle-Validated setting for nofile soft limit is 131072
oracle soft nofile 131072

# Oracle-Validated setting for nofile hard limit is 131072
oracle hard nofile 131072

# Oracle-Validated setting for nproc soft limit is 131072
oracle soft nproc 131072

# Oracle-Validated setting for nproc hard limit is 131072
oracle hard nproc 131072

# Oracle-Validated setting for core soft limit is unlimited
oracle   soft   core    unlimited

# Oracle-Validated setting for core hard limit is unlimited
oracle   hard   core    unlimited

No comments:

Post a Comment