Cheatsheet to working with ulimits and too many open files.
- list how many open file descriptors a process has
lsof -P [pid] | wc -l
ls /proc/[pid]/fd | wc -l
(cheaper)- look at limits for a specific process
cat /proc/[pid]/limits
- set limits for a user
- futz with
/etc/security/limits.conf
or/etc/security/limits.d/*
- show ulimits for the current process
ulimit -a
- set number of open file handle limit for the current process (and processes spawned from this one)
ulimit -n 16384
(note - only root can raise hard limits)