Search code examples
linuxubuntuneo4jlimitulimit

How to increase Neo4j's maximum file open limit (ulimit) in Ubuntu?


Currently ulimit -n shows 10000. I want to increase it to 40000. I've edited "/etc/sysctl.conf" and put fs.file-max=40000. I've also edited /etc/security/limits.conf and updated hard and soft values. But still ulimit shows 10000. After making all these changes I rebooted my laptop. I've access to root password.

usr_name@usr_name-lap:/etc$ /sbin/sysctl fs.file-max
fs.file-max = 500000

Added following lines in /etc/security/limits.conf -

*     soft    nofile          40000
*     hard    nofile          40000

I also added following line in /etc/pam.d/su-

session    required   pam_limits.so

I've tried every possible way as given on other forums, but I can reach up to a maximum limit of 10000, not beyond that. What can be the issue?

I'm making this change because neo4j throws maximum open file limits reached error.


Solution

  • I am using Debian but this solution should work fine with Ubuntu.
    You have to add a line in the neo4j-service script.
    Here is what I have done :

    nano /etc/init.d/neo4j-service
    Add « ulimit –n 40000 » just before the start-stop-daemon line in the do_start section

    Note that I am using version 2.0 Enterprise edition. Hope this will help you.