cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Parallel in all socket while apoc.periodic.iterate

Peter_Lian
Node Clone

There're two socket of cpu with each 8 core & 16 thread in my computer (i.e., total 2*8 core and 16*2 thread).

When I was running  apoc.periodic.iterate with parallel = TRUE, for example,

 

CALL apoc.periodic.iterate(

'MATCH (n) RETURN id(n) AS id',
'MATCH (n) WHERE id(n)=id DELETE n',
{batchSize: 5000, parallel :true});

 

I find (using HWiNFO64 and task manager) that It did parallel but only in one of socket's cpu, i.e, only 8 core were parallel, others (16-8=8) were not running.

 

Question : Is this the limitation of neo4j that it can only parallel in one socket's cpu, or is there any method to solve this problem (that I want to parallel in all socket, i.e., all CPU but not just one of socket)

 

 

By the way, I notice that the parallel method in Neo4j is "multi-process". Can neo4j parallel in multi-thread?

 

Thanks.

3 REPLIES 3

Hello @Peter_Lian 😊

Did try to play with the concurrency parameter?

Moreover, if you want to erase the whole database, you should use CREATE OR REPLACE DATABASE name_of_your_database

Regards,
Cobra

No, how to set concurrency parameter?

The example of apoc.periodic.iterate just an example, but thanks for your suggestion !

For example:

CALL apoc.periodic.iterate(
    "MATCH (n) RETURN n",
    "SET n.value = true",
    {batchSize:100, parallel:true, concurrency:4}
)

Regards,
Cobra

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online