I have a process running as root that is capped to 1024 ( in reality lsof shows me up to 1031 for it) open files but I don't find the file to modify this limit.
Here is the output of cat /proc/PID/limits to confirm it
#cat /proc/32531/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 515045 515045 processes
Max open files 1024 4096 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 515045 515045 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
However, I can't find that limit in "classic" config files :
#cat /proc/sys/fs/file-max
13106306
#ulimit -S -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) 515045
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 515045
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
#ulimit -H -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 515045
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 515045
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
/etc/security/limits.conf is fully commented and /etc/security/limits.d/ is empty
I'm running debian 8.8 (jessie) on Linux version 3.14.32-xxxx-grs-ipv6-64 (kernel@kernel.ovh.net) (gcc version 4.9.2 (Debian 4.9.2-10) )
Thanks,
Best Answer
Is this a process launched by systemd? systemd uses its own limits, and does not use the values from limits.conf (pam_limits). You will have to set the LimitNOFILE directive to increase it.
In the absence of the directive either in the unit file or globally in
/etc/systemd/system.conf
, systemd will make a note of the limits which were in place when it (the init process, process 1) was launched by the kernel. This is hard coded in the Linux kernel to a soft limit of 1024 and a hard limit of 4096 since version 2.6.39.