On RHEL, I have the "too many open files" error. I'd like to reproduce it so that I understand what exactly is causing it.
cat /proc/sys/fs/file-maxgives the max open files at OS-level../file-nrgives the number of current open filessudo lsof | wc -lis another way to look at the amount of current open files alhough it contains duplicated values as mentioned here.ulimit -nis the max open files per process (for me 1024)sudo lsof -p <PID> | wc -lgives thelsofversion of the number of open files for a current process.
I would be after a bash solution if possible, that creates a process that blows up the ulimit -n just by opening dummy files. Potentially, I'd like to use several of those test processes to blow up the OS limit as well.
Also how can I properly kill such processes? Thanks
This will allow me to check exactly what limit is reached (file-max or lsof...) and to experiment on what kind of operations are causing it.