from 'man proc':
This file defines a system-wide limit on the number of
files for all processes. (See also setrlimit(2),
which can be
used by a process to set the per-process limit,
on the number of files it may open.) If you get lots of
messages about running out of file handles, try increasing
echo 100000 > /proc/sys/fs/file-max
The kernel constant NR_OPEN imposes an upper limit on the
that may be placed in file-max.
If you increase /proc/sys/fs/file-max, be sure to
/proc/sys/fs/inode-max to 3-4 times the new value
/proc/sys/fs/file-max, or you will run out of inodes.
This (read-only) file gives the number of files
opened. It contains three numbers: the number of allocated
handles; the number of free file handles; and the maximum
of file handles. The kernel allocates file handles
but it doesn't free them again. If the number of
files is close to the maximum, you should consider
the maximum. When the number of free file handles is
you've encountered a peak in your usage of file handles and
probably don't need to increase the maximum.
The second number is worth looking at to see if the first number is what you need to increase. If so, you can set it in your /etc/sysctl.conf with:
Note that this sets the system limit; the per-user limit is set with 'ulimit', which you already indicated you were familiar with.