WebApp Error: : [Errno 24] Too many open files


Most likely the number of file descriptors not enough.
Check for number of file descriptors with

ulimit -a
ulimit -n

Increase in /etc/security/limits.conf


username hard nofile 3072
username soft nofile 2048

Another things to do, if above solution doesn’t help. As suggested at slashdot, increase number of max open connections in sysctl.conf, kernel headers and security limits.

Params that configure max open connections.

At /etc/sysctl.conf add:

net.core.somaxconn=131072
fs.file-max=131072

and then:

sudo sysctl -p

at /usr/include/linux/limits.h

change:

NR_OPEN = 65536

at /etc/security/limits.conf

add:

* soft nofile 65535
* hard nofile 65535