Friday, December 11, 2015

Troubleshout Open file limit

lsof | awk '{ print $2; }' | uniq -c | sort -rn | head

- Show no of open files sorted by PID

cat /proc/<PID>/limits

- Check individual file limits of a process

ls /proc/<PID>/fd | wc -l

- to obtain a precise count of the open files at given instant of time

lsof -p <PID>
- This will list all open files with given process

In some cases you might have to look at the open file limit of the process which started your process.

Make sure you add "ulimit -n XXX" values inside your startup script, if you have configured it to start the process on machine startup or restart. Especially on Debian Linux flavour refer (