[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Too many open files



Hi Michael, List,

I apologize for re-sending the message, and now responding to my own not your reply. My initial message was sent when I was not subscribed to the list. I was looking at the archive website and did not see it show up there (I was looking in the wrong place) so I subscribed and re-sent. Hence it appearing 2x. I'm now subscribed and should see replies and be able to reply to them properly.

ulimit -Hn and -Sn both report 32768, so that's not it.

> Peeking on my fairly busy 12 Bookworm host ...
> # 2>>/dev/null ls -d /proc/[0-9]*/fd/* | wc -l
> 2171

$ 2>>/dev/null ls -d /proc/[0-9]*/fd/* | wc -l
5503

$ cat /proc/sys/fs/file-max
1000000

Also seen at

$ cat /proc/sys/fs/file-nr
25312   0       1000000

Seems reasonable so far, and nothing obvious (to me) in dmesg.

journalctl shows tons of errors (OpenGL, X11 even though I'm on Wayland, Qt, etc.) and shows it occurring more than the few times I see it from some terminal commands that I run. But nothing is crashing because of it as far as I can tell. 

> $ dolphin . kf.solid.backends.fstab: Failed to acquire watch file
> descriptor Too many open files

Dolphin still opens.

> $ tail -f some_big_file tail: inotify cannot be used, reverting to
> polling: Too many open files

Tail still works.


Your suggestion to look at /proc/*/limits  shows:
$ cat /proc/[0-9]*/limits 2>>/dev/null | sed -ne '1p;/^Max open files/p' | sort | uniq -c | sed -e 's/  *$//;s/  //' | sort -k 5bn
    1 Limit                     Soft Limit           Hard Limit           Units
    1 Max open files            50                   50                   files
  268 Max open files            1024                 4096                 files
   29 Max open files            1024                 524288               files
  100 Max open files            4096                 524288               files
    6 Max open files            8192                 524288               files
   22 Max open files            32768                32768                files
    1 Max open files            65535                524288               files
   19 Max open files            65536                524288               files
    3 Max open files            65536                65536                files
    2 Max open files            131072               131072               files
    5 Max open files            524287               524288               files
   29 Max open files            524288               524288               files
   17 Max open files            1000000              1000000              files
    3 Max open files            1073741816           1073741816           files

Looking at that last line:

$ grep 1073741816 /proc/[0-9]*/limits
/proc/1644/limits:Max open files            1073741816           1073741816           files     
/proc/1/limits:Max open files            1073741816           1073741816           files     
/proc/770/limits:Max open files            1073741816           1073741816           files     

$ ps aux | grep -E " 1644 | 770 "
root         770  0.0  0.0  37164 11844 ?        Ss   Aug14   0:32 /usr/lib/systemd/systemd-udevd
root        1644  0.0  0.0 2467416 53796 ?       Ssl  Aug14   3:13 /usr/bin/containerd


But I'm not sure what to do with this information...

Thanks for your help so far,

  -k.


Reply to: