lsof vs. cat /proc/sys/fs/file-nr vs. ulimit
ulimit seems to be per process maximum, correct? I see my process running out of file descriptors and I know increasing the ulimit will fix it. Before I fix it though, I am trying to find a program that shows the number of files I have open. I know inside proc, I can do "ls -l /proc/21195/fd/ | wc -l" which says I hava 1023 open...hmmmm, we changed the ulimit from 1024 to 4096 and 1023 is really close to 1024(maybe it closed one file since running out).....maybe the limit is smaller than I think. Is there a different command to see the file descriptor limit for a process(as I understand it there are overrides from the system), but I checked some file "vi /etc/security/limits.conf" and saw it was 4096 for my user in there too. any ideas on this one?
1. how to check the maximum files for my pid?
2. how to list the current number of files open? (I assume my command above is correct for that on ls | wc -l?)