-bash: /usr/bin/id: Too many open files in system

Today I faced an issue while logging into a VPS from node.

 

# vzctl enter 101
entered into CT 101
-bash: /bin/egrep: Too many open files in system
-bash: /bin/egrep: Too many open files in system
-bash: /bin/egrep: Too many open files in system

While checking the UBC parameters for the respective VPS server, by viewing the output of /proc/user_beancounters, I could see that the parameter ‘numfile’ was hitting failcount. Numfile is the parameter for number of open files in a VPS. Increasing the limit fixed the issue.

# vzctl set 101 –numfile 500000:500000 –save
UB limits were set successfully
Saved parameters for CT 101

 

cPanel Internal Server Error more than 400 attempts to create a session failed

Loading Cpanel or WHM Link in browser throws this error :

Internal Server Error
more than 400 attempts to create a session failed
cpsrvd/11.25 Server at 1.2.3.4

Reason :
This is most of the time caused by the Inodes hitting their limit inside a VPS.
Resolution:
Check the Inodes usage on the VPS using below command :
df -i

If the usage is indeed 100% then increase the inodes for that vps using the following command in node

vzctl set <veid> –diskinodes barrier:limit –save