-
Step 1 (ulimit): open the sysctl.conf and add this line fs.file-max = 65536
vi /etc/sysctl.conf
add following at end of file in above file:
fs.file-max = 65536
save and exit.
-
Step 2 (ulimit):
vi /etc/security/limits.conf
Add following 4 lines in above file
* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535
save and exit check max open file ulimit
Example command to verify and sample output:
[root@localhost# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 127358
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
**OPEN FILES (-N) 65535**
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Increase max user processes in Linux
-
Step 1 (user processes):
vi /etc/security/limits.conf
add following in above file
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
- Step 2 (user processes): vi /etc/security/limits.d/90-nproc.conf
add following in above file
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
save and exit check the user max processes ulimit
[root@localhost# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 127358
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
**MAX USER PROCESSES (-U) 65535**
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Thank's alot this helps, but i do have one question : why "65535" & not for example some higher value ?