Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

neo4j and max open files

Tags:

ubuntu

neo4j

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.

like image 558
Yaron Naveh Avatar asked Jul 21 '12 22:07

Yaron Naveh


2 Answers

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

like image 139
kmario23 Avatar answered Sep 17 '22 15:09

kmario23


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

  • https://neo4j.com/docs/operations-manual/current/installation/linux/debian/#debian-operation
  • https://neo4j.com/developer/kb/how-do-i-set-max-open-files-for-debian-installs/
like image 28
user3315491 Avatar answered Sep 18 '22 15:09

user3315491