0

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,

  • OK. Load this page again, and look over to the right hand side, and see if any of those questions about limits and debian look like yours. If they do, look at them! – quadruplebucky Jun 16 '17 at 9:23
  • Thank you for your comment but even though I might have missed some of them I already read a fair number of them and my question is somewhat different since I am not asking how to modify those limits but WHERE those are stored ( which file(s) ). Moreover the result of ulimit -S -a doesn't match the output of cat /proc/32531/limits. This is why even though I might be wrong I think it is relevant to open a new question. – shrimpdrake Jun 16 '17 at 9:34
  • You're right. It doesn't make any sense at all. It's confusing. There are kernel limits. Group limits. Shell limits. Process limits....and sometimes you have no idea which one you're up against. sysctl -a , /etc/login.conf, man -k limit, and poking around in /proc are all good starting places. Also kernel configs – quadruplebucky Jun 16 '17 at 9:53
0

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.

  • Indeed this program is started using service start which on my system seems to be just a wraper for systemd in practice. There is that directive #DefaultLimitNOFILE= in the file /etc/systemd/system.conf but where is stored the default value of 1024 ? And where does that "hard" 4096 limit comes from ? Thanks – shrimpdrake Jun 16 '17 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.