Quote:
Originally Posted by closet geek
Well, lsof | wc -l seems to do. That outputs 39537, however ulimit -a says only 4096 files are allowed to be opened at a time. Yet /proc/sys/fs/file-max gives 131072 file desriptors allowed and apparently the system in question here is only using 11920.
p.s. is ulimit per-process limits?
|
Yes ulimit is a per process limit and you can increase or decrease it. Also the /proc/sys/fs/file-max tells the maximum open file descriptors allowed by the kernel.
Ok now if you see /proc/sys/fs/file-nr, the first column show number of current open file descriptors and the third column show the total allowed file descriptors which is equal to /proc/sys/fs/file-max. But lsof | wc -l will show you more number then that in the first column, that is because lsof will also list files without a file discreptor(e.g. you may see a lot of memory maped library files). To check this try lsof | wc -l | grep 4893 (where 4893 is pid of some process just taken for example), now check for the same pid in /proc/4893/fd. You will see the difference. Also if you want, you can set the /proc/sys/fs/file-max as follows.
e.g. echo "12227" > /proc/sys/fs/file-max.
I think it is much clear now.
Quote:
Originally Posted by closet geek
Yet Apache still gives:
"host: isc_socket_create: not enough free resources"
which I'm reliably informed is a problem with the number of files opened.
|
Not very much sure about the above question but maybe it is because the per-process limit is 4096, which may be less for Apache. Increasing this limit should help you.