Archive for January, 2018

Increase the ulimit in Linux

Posted: January 9, 2018 in Uncategorized

Sometimes we may encounter few issues like application is slow, server consuming lot of cpu/memory and too many openfiles etc..

To avoid those kind of issues, from the server side we can increase the ulimit.

By default it is 1024. So we can increase upto 4096

Steps to increase the ulimit on server.

  1. Log on to server
  2. Check the current ulimit with below command

ulimit -n  

If it shows 1024 then increase that with below command

3. Open the file

/etc/security/limits.conf

and add below lines at the end of the file

* soft nofile 4096
* hard nofile 4096

Save the file and exit

4. Logout from the current session and login back to server

5. Check the ulimit value again. It shows current ulimit set for the server is 4096

ulimit -n