Comments (4)
Thanks for the explanation! I will check the query and update the post.
from bytefish.de.
@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.
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.
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:
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.
Query Plan
from bytefish.de.
Related Issues (20)
- TransactionalTestBase package? HOT 1
- Thank you for the excellent article. Unfortunately, it did not work for me. HOT 2
- Question: Usage of bytea HOT 1
- Sql minor bug HOT 1
- Auto Configuere data source in data base per tenant HOT 1
- Spring Boot Multitenancy guide - Error with AbstractRoutingDataSource HOT 3
- Query on spring abstractroutingdatasource advantage HOT 2
- Question on dynamic load of the data source HOT 10
- Add a flow diagram HOT 7
- NEST not working HOT 1
- Adding null in AuditQueryResultUtil HOT 3
- How the tenant can be changed on runtime HOT 1
- Can't write CLR type System.DateTime to database type timestamp with time zone HOT 1
- AbstractMap used by PersonMap in SqlMapper blog entry doesn't match java.util.AbstractMap HOT 7
- Update async multi-tenant example HOT 3
- Select tenant HOT 1
- Subject: Parsing Command Line Arguments in .NET || Topic: Add basic arg validation HOT 2
- How to addnew datasource without @Scheduled HOT 1
- How can we do the reverting to a particular revision using Versioning and Auditing with spring data Envers? please provider me an example for reverting HOT 2
- Tables are not getting created while dynamically tenant details in tenant.json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bytefish.de.