Hi,
I don't understand some performance issues i'm having,
I'm running a script on two different laptop
Laptop A, which has 4 core ang 16 Gb memory , and Laptop B which has 8 core and 16 gb memory)
Everything else is the same on the two laptop (OS =Windows, neo4j desktop with Neo4j v=5.22.0, same neo4j.conf file, same database with same data etc...)
So i expected Laptop B to run the script faster, but it's quite the opposite
On laptop B (which has more CPU) in the task manager i can see that my processor is used at only 10% (while script is running), my memory is at 50-60% and the disk usage for I/O is at 5% , so none of them is overwhelmed and i can't make it use more of my CPU and memory to go faster, since it's clearly not at maximum capacity
I've tried increasing (even more than current values) :
dbms.memory.heap.initial_size=2G
dbms.memory.heap.max_size=3G
dbms.memory.pagecache.size=2G
it didn't change anything,
I also played around with dbms.threads.worker_count (tried 16, 10, 8, 5)
did'n change anything in terms of speed
My problem is not so much that the script or config might be under-optimized, it's mostly that the config is the same on the two laptop, and the one with more capabilities is actualy going slower than the other one,
Even if they go slow, laptop B should be at least slightly faster or at very least be of similar speed, (after 1h, laptop A did 100% of a task while laptop B did less than 70% of the same task)
Thank you for any reply that can help me understand this better
With the info you've given so far, no one will be able to help you very much. However, if you could share "the script" we might be able to help a little.
If "the script" is reading an existing database in some way we might have one set of ideas. However, if "the script" is creating or updating a large database, then we might have another set of ideas, including looking at how fast the hardcrives are.
Hi,
Thanks for your reply
My point was exactly that it's not about the script since they are the same one the two laptop
Im not exactly looking for optimizing the script, i know it can be faster, i'm looking for the reason behind the time difference with the exact same script
And i didn't put any script here because i tried multiple ways to do it, everytime laptop B is slower despite being with higher caapcity
But it's basically creating relationship on large dataset
i've tried different way like : (don't take it as is, it's just example code not an exact copy paste, all code were working, they were just slower on laptop B)
1)
MATCH (n {varfilter: 'z'}), MATCH (m) WHERE (condition)
CREATE (n)-[r:name {score: x}]->(m)
MATCH (n), MATCH (m) WHERE (condition2)
CREATE (n {varfilter: 'z'})-[r:name {score: y}]->(m)
MATCH (n {varfilter: 'z'}),
WITH n,
MATCH (m) WHERE condition
CREATE ... -[r: {score:x}]->...
WITH n,
MATCH (m) WHERE condition2
CREATE ...-[r:{score:y}]->...
MATCH (n{varfilter: 'z'})
WITH n,
MATCH (m)
CASE
WHEN condition
THEN x
WHEN condition2
THEN y
ELSE 0
WHERE score >0
CREATE (n)-[r:{score:score}]-(m)
The same than above but with CALL apoc.periodic.iterate
And other ways, but really please don't focus on the code as it is litterally not my problem if it can be optimized, I just want to understand why with same code, performances were better on lesser laptop
I did not mention it, but also L2 and L3 Cache were higher in laptop B despite processing data slower