bin\neo4j-admin backup to backup
a Neo4j database, Neo4j Support recommends explicitly defining the JVM heap size and pagecache memory to be used by the backup JVM
If these are not defined then when
neo4j-admin backup is executed, the JVM will allocate a default heap size and the pagecache will
use the value defined
in the dbms.memory.pagecache.size setting from conf/neo4j.conf. In most cases the conf/neo4j.conf defines these parameters
such that they consume over 60% of total RAM. As such, if
neo4j-admin backup were to allocate the same values for heap and pagecache
as the running Neo4j process, we would consume all available RAM leading to backup failure and out of memory conditions.
To specify the JVM heap for
neo4j-admin backup, set the environment variable HEAP_SIZE, for example:
To specify the pagecache allocation for
Neo4j 3.3.1 forward
As a result of PR 10463, specify the pagecache value on the command line
replacing XX with the about of megabytes to allocate for the pagecache. The –pagecache command line argument overrides any and all other defined pagecache settings in any neo4j.conf files.
Neo4j 3.2.x through Neo4j 3.3.0
first create a directory specific for the backup config file and then set the environment variable NEO4J_CONF:
Then, in /tmp/backup create a file named neo4j.conf with the following content:
For environments that were installed through Debian (i.e. apt-get install neo4j-enterprise) you will also need to add
to this neo4j.conf file.
Be sure not to exceed the total physical RAM on the server between the Neo4j database plus the backup process.