Giter VIP home page Giter VIP logo

Comments (4)

bytefish avatar bytefish commented on September 26, 2024

Thanks for the explanation! I will check the query and update the post.

from bytefish.de.

bytefish avatar bytefish commented on September 26, 2024

@jexp I won't be able to evaluate it before the weekend. Before I start: Do you have any hints, which configuration settings in the neo4j.conf I should adjust? I will of course also follow the Neo4j documentation on Performance settings.

from bytefish.de.

jexp avatar jexp commented on September 26, 2024

Don't worry :) it's holiday weekend after all.

Basically look at the store size and adjust the page-cache setting to fit that, e.g. 6G and then use e.g. 8G for heap. See below.

Definitely, check out Neo4j Desktop with Neo4j Enterprise 3.3.5

# Java Heap Size: by default the Java heap size is dynamically
# calculated based on available system resources.
# Uncomment these lines to set specific initial and maximum
# heap size.
dbms.memory.heap.initial_size=8G
dbms.memory.heap.max_size=8G

# 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.memory.pagecache.size=6G

from bytefish.de.

bytefish avatar bytefish commented on September 26, 2024

Database Size

The database has a size of 2.36 GB.

Configuration

When I used the configuration and query you provided, my system acted very strange. The query took 250 seconds on a cold run. I used the following configuration instead, which should still fit with the database size:

# Java Heap Size: by default the Java heap size is dynamically
# calculated based on available system resources.
# Uncomment these lines to set specific initial and maximum
# heap size.
dbms.memory.heap.initial_size=5g
dbms.memory.heap.max_size=5g

# 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.memory.pagecache.size=3g

Then I ran your query two times: On a cold run after starting the Neo4j Database and with a second run, which should have the database cached in RAM.

Query

MATCH (r:Reason {description:'Weather'})
MATCH (a:Airport)
WITH r, a, size( (a)<-[:ORIGIN]-() ) as total
MATCH (a)<-[:ORIGIN]-(f:Flight)-[:DELAYED_BY]->(r)
WITH a, total, COUNT(f) AS num
RETURN a.abbr + ' - ' + a.name AS Airport, ((1.0 * num) / total) * 100 AS Percent
ORDER BY Percent DESC
LIMIT 10

First Run

On a cold run the query takes 30 Seconds to run:

image

Second Run

Subsequent runs on the database apparently have the Neo4j Database cached in RAM. I see no disk activity and the queries finish consistently in 17 seconds.

image

Query Plan

image

from bytefish.de.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.