OBM Increase open file limits


The default file limits for most linux machines is very low and so needs to be adjusted in most cases. This article walks you through how to validate and set recommended limits. 

default settings is 1024

This is typically encountered with a log line similar to

log
java.nio.file.FileSystemException: /proc/stat: Too many open files
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:103)

Step-by-step guide

1) log in as root user

2) execute the below command and verify if output isn't 1024

ulimit -Hn

Proceed with the below steps 

1)edit the file

vi /etc/sysctl.conf

2) Add following line,hit "i" for insert mode after opening the file vim editor

fs.file-max=100000

3) save the changes , hit 'esc' to switch mode and key in

:wq

4) Apply the settings by running the command

sysctl -p

5) edit the file

vi /etc/security/limits.conf

6) Add the following, hit "i" for insert mode after opening the file vim editor

*   hardnofile100000
*soft nofile100000

7) save the changes , hit 'esc' to switch the mode and key in

:wq

8) reboot the server for the changes to be effective

/sbin/reboot now




 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*