Table of Contents

linux#kernle

ulimit - How to Set the ulimit values in Linux

Check

[root@test-server-1 ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals                 (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 32762
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
(abbr)
[root@test-server-1 ~]# ulimit -n
1024
[root@test-server-1 ~]#


Configuration

/etc/security/limits.conf

#open files
* soft nofile 30000
* hard nofile 30000

#max user processes
* soft nproc  30000
* hard nproc  30000


How to change open files in CentOS6/CentOS7

$ ulimit -u
4096
$ cat /etc/security/limits.d/*-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     4096
root       soft    nproc     unlimited

$ rm /etc/security/limits.d/*-nproc.conf
$ ulimit -u
unlimited