Tuesday, November 16, 2021

[SOLVED] How to increase maximum open file limit in Red Hat Enterprise Linux 5?

Issue

As the title says.

I've found this question: How to increase Neo4j's maximum file open limit (ulimit) in Ubuntu?

But I don't even has this file: /etc/init.d/neo4j-service, I'm guessing it's because I'm using RHEL5, not Debian, as the responder was using.

Then I've added both two lines:

root soft nofile 40000 root hard nofile 40000

into my /etc/security/limits.conf

Then after logging out and logging in again, $ulimit -Sn and $ulimit -Hn still returns 1024,

Also, I don't even has this file: /etc/pam.d/common-session under pam.d directory. Should I create this file myself and just one that one line in here? I don't think this should be the way out.

Any ideas please?

Thanks


Solution

I don't know what is true RHEL way, but you can change the limit using sysctl:

$ sysctl -w fs.file-max=100000

To make the change permanent, add next string to /etc/sysctl.conf:

fs.file-max = 100000

then apply the change using command

$ sysctl -p



Answered By - Oleksandr Kravchuk