If you want to see how many file handles are being used system-wide,
cat /proc/sys/fs/file-nr. The middle number is the one you want, and the third number is the system limit. To increase the limit, you can write a number into
/proc/sys/fs/file-max, like this:
echo 8192 > /proc/sys/fs/file-max
If you want the change to be persistent, add that command to
/etc/rc.d/rc.local so it'll be run at startup.
And yes, open sockets count towards the total. It's the number of file handles that are limited, rather than the number of actual files that can be opened at once.