This is an old revision of the document!
Table of Contents
NEO4J
Neo4J configuration
- /.../neo4j/conf/neo4j.properties
################################################################ # Neo4j # # neo4j.properties - database tuning parameters # ################################################################ # Enable this to be able to upgrade a store from an older version. #allow_store_upgrade=true # The amount of memory to use for mapping the store files, in bytes (or # kilobytes with the 'k' suffix, megabytes with 'm' and gigabytes with 'g'). # If Neo4j is running on a dedicated server, then it is generally recommended # to leave about 2-4 gigabytes for the operating system, give the JVM enough # heap to hold all your transaction state and query context, and then leave the # rest for the page cache. # The default page cache memory assumes the machine is dedicated to running # Neo4j, and is heuristically set to 50% of RAM minus the max Java heap size. #dbms.pagecache.memory=10g dbms.security.auth_enabled=false # Enable this to specify a parser other than the default one. #cypher_parser_version=2.0 # Set the root directory for use with file URLs (`file:///`) in LOAD CSV. # If enabled, file URLs will refer to locations inside the `data/import` # directory. I.e. `file:///movies/actors.csv` will load from the file # `data/import/movies/actors.csv`. #dbms.security.load_csv_file_url_root=data/import # Keep logical logs, helps debugging but uses more disk space, enabled for # legacy reasons To limit space needed to store historical logs use values such # as: "7 days" or "100M size" instead of "true". #keep_logical_logs=7 days # Enable shell server so that remote clients can connect via Neo4j shell. #remote_shell_enabled=true # The network interface IP the shell will listen on (use 0.0.0.0 for all interfaces). #remote_shell_host=127.0.0.1 # The port the shell will listen on, default is 1337. #remote_shell_port=1337 # Enable online backups to be taken from this database. online_backup_enabled=true # Port to listen to for incoming backup requests. online_backup_server=192.168.168.33:6362 # Uncomment and specify these lines for running Neo4j in High Availability mode. # See the High availability setup tutorial for more details on these settings # http://neo4j.com/docs/2.3.2/ha-setup-tutorial.html # ha.server_id is the number of each instance in the HA cluster. It should be # an integer (e.g. 1), and should be unique for each cluster instance. ha.server_id=1 # ha.initial_hosts is a comma-separated list (without spaces) of the host:port # where the ha.cluster_server of all instances will be listening. Typically # this will be the same for all cluster instances. ha.initial_hosts=192.168.168.33:5001,192.168.168.34:5001 # IP and port for this instance to listen on, for communicating cluster status # information iwth other instances (also see ha.initial_hosts). The IP # must be the configured IP address for one of the local interfaces. ha.cluster_server=192.168.168.33:5001 # IP and port for this instance to listen on, for communicating transaction # data with other instances (also see ha.initial_hosts). The IP # must be the configured IP address for one of the local interfaces. ha.server=192.168.168.33:6001 # The interval at which slaves will pull updates from the master. Comment out # the option to disable periodic pulling of updates. Unit is seconds. ha.pull_interval=10 # Amount of slaves the master will try to push a transaction to upon commit # (default is 1). The master will optimistically continue and not fail the # transaction even if it fails to reach the push factor. Setting this to 0 will # increase write performance when writing through master but could potentially # lead to branched data (or loss of transaction) if the master goes down. #ha.tx_push_factor=1 # Strategy the master will use when pushing data to slaves (if the push factor # is greater than 0). There are two options available "fixed" (default) or # "round_robin". Fixed will start by pushing to slaves ordered by server id # (highest first) improving performance since the slaves only have to cache up # one transaction at a time. #ha.tx_push_strategy=fixed # Policy for how to handle branched data. #branched_data_policy=keep_all # Clustering timeouts # Default timeout. #ha.default_timeout=5s # How often heartbeat messages should be sent. Defaults to ha.default_timeout. #ha.heartbeat_interval=5s # Timeout for heartbeats between cluster members. Should be at least twice that of ha.heartbeat_interval. #heartbeat_timeout=11s
Linux performance tune
Useful Cypher Queries
- /etc/security/limits.conf
neo4j soft nofile 40000 neo4j hard nofile 40000
echo 'deadline' > /sys/block/sda/queue/scheduler cat /sys/block/sda/queue/scheduler noop [deadline] cfq
- /etc/haproxy/haproxy-neo4j.cfg
global daemon maxconn 384 defaults mode http timeout connect 5000ms timeout client 50000ms timeout server 50000ms frontend http-in bind *:7777 default_backend neo4j backend neo4j option httpchk GET /db/manage/server/ha/available server s1 192.168.168.33:7474 maxconn 128 check server s2 192.168.168.34:7474 maxconn 128 check server s3 192.168.168.35:7474 maxconn 128 check listen admin bind *:7770 stats enable
haproxy -f /etc/haproxy/haproxy-neo4j.cfg