Fixing “Too Many Open Files” Error on Linux VPS

Fixing “Too Many Open Files” Error on Linux VPS

The “Too Many Open Files” error occurs when applications exceed the allowed number of open file descriptors.

Step 1: Check Current Limits

ulimit -n

Step 2: Increase Limits

Edit:

nano /etc/security/limits.conf

Add:

* soft nofile 100000 * hard nofile 100000

Step 3: Apply Changes

Log out and back in, or restart services.

Warning:
Setting limits too high may impact system stability.

Note:
This issue is common on high-traffic servers and databases.