How to lsof report a higher number of open files than what ulimit says should be allowed

lsofmax-file-descriptorsulimit

How can lsof report more open files than what ulimit says is the limit?

prod_web3(i-ca0b05aa):~$ sudo lsof | wc -l
4399
prod_web3(i-ca0b05aa):~$ ulimit -n
1024

Best Answer

From the ulimit builtins man page

The ulimit builtin provides control over the resources available to the shell 
and to processes started by it on systems that allow such control.

Your lsof command lists all of the open files for all processes for all users on the system. You are not comparing like with like.