Increase the number of Open files Limit in Linux

INCREASE THE NUMBER OF OPEN FILES LIMIT IN LINUX

 

If you see:

You can see what your current max open files limit is by running the following commands:

ulimit -Hn (Hard limit)

and

ulimit -Sn (Soft limit)

By default it will give you a limit of 1024. Nowadays this is way short of what many applications require.

In order to increase this limit to say, 65535, run the following command as root:

ulimit -n 65535

You can check that it has updated by running the top two commands again.

However this limit is forgotten upon reboot. In order for this update to be permanent, you need to update the following file:

vi /etc/security/limits.conf

Add the following two lines with the number you require replacing 65535:

* soft nofile 65535
* hard nofile 65535

Eh Voila – all done…