Tuesday 12 November 2013

How do I increase the open files limit for a non-root user

Recently, I have tried to increase the number of open files allowed for a user, as for carrying out a load test for a Java application server where the current limit of 1024 is not enough.

As the beginning you have to change the SOFT limit and the HARD limit, by changing following file as follows;
/etc/security/limits.conf.

* soft nofile 4096
* hard nofile 4096


The first column describes WHO the limit is to apply for. '*' is a wildcard, meaning all users. To raise the limits for root, you have to explicitly enter 'root' instead of '*'.

You also need to edit /etc/pam.d/common-session* and add the following line to the end:

session required pam_limits.so

This will help you to get rid of "Too many Open File" exception!.

No comments:

Post a Comment