14

I'm using neo4j 1.8M06 on ubuntu. When I start it, I get this warning:

WARNING: Max 1024 open files allowed, minimum of 40 000 recommended.

what does it mean? If it is required, how can I adjust this setting?

I've seen this thread on the issue but still could not understand it.

kmario23
  • 57,311
  • 13
  • 161
  • 150
Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158

2 Answers2

15

It means that you can open only '1024'(default) files for writing. But NEO4J recommends this value to be 40K. This can be achieved with the fix as described below.

Edit /etc/security/limits.conf and add these two lines:

root   soft    nofile  40000
root   hard    nofile  40000

The neo4j recommends "neo4j" in place of "root" here. That won't work.

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

session required pam_limits.so

And yes, finally you've to restart NEO4J.

sudo service neo4j-service restart

Reference: NEO4J server setup

kmario23
  • 57,311
  • 13
  • 161
  • 150
  • 2
    Don't forget to restart after that – Pum Walters Sep 12 '14 at 15:42
  • 1
    The Neo4j documentation did not work for me, however this answer did. Running Neo4j 3.0.2 on Ubuntu 14.04. I put the "session required pam_limit.so" in /etc/pam.d/common-session-noninteractive, presumably because I am running neo4j as a service and used "root" as described in this answer. – Brooks Jun 04 '16 at 20:50
4

For now(neo4j 3.1.1), neo4j has the official solution for this.

Most Neo4j configuration goes into neo4j.conf. Some package-specific options are set in /etc/default/neo4j.

Add this config to /etc/default/neo4j

NEO4J_ULIMIT_NOFILE=40000

then restart the neo4j service to get it work.

sudo service neo4j start

see

  • Worked for me on Ubuntu 16.04 & Neo4j 3.1.1 – Merrick Mar 03 '17 at 20:12
  • This is by far the simplest config change. Confused as to why this isn't the default given the strong recommendation... – sihil Apr 04 '17 at 15:23
  • In neo4j `3.5.x` on Debian, the conf in `/etc/default/neo4j` are overrided by systemd. See `systemctl cat neo4j.service` to see where it's overrided – Pierre Apr 16 '19 at 11:20