# Importing Relationships / Nodes very slow

**URL:** <https://community.neo4j.com/t/importing-relationships-nodes-very-slow/15327>\
**Category:** Import / Export\
**Tags:** performance, cypher, import\
**Created:** [March 4, 2020, 10:55am UTC](https://community.neo4j.com/t/importing-relationships-nodes-very-slow/15327 "2020-03-04T10:55:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iliasse](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/iliasse/32/9173_2.png) [@Iliasse](https://community.neo4j.com/u/Iliasse)\
**Post date:** [March 4, 2020, 10:55am UTC](https://community.neo4j.com/t/importing-relationships-nodes-very-slow/15327/1 "2020-03-04T10:55:29Z")

</div>

Hi,

Before posting this I searched for a similar topic and the closest is [**this one**](https://community.neo4j.com/t/performance-issue-when-importing-csv-relationships/4677) but unfortunately there is not reply since more than 1 year.

here is my setup :  
Neo4j 3.5.14  
Ubuntu 18.04.3  
Intel(R) Xeon(R) W-2195 18 cores 36 threads  
250 GB RAM

informations about my Neo4J DB :  
total size : 298 GB  
number of nodes: 399 027 743  
number of relationship: 818 190 432  
number of properties: 1 951 751 856

and the conf file about the RAM :  
dbms.jvm.additional=-XX:+UseG1GC -Xms32g -Xmx160g

I let **memory.heap** conf with the default parameter (dynamically calculated based on available system resources).

I need to import more relationship and data every weeks but i'm facing performance issues. This is not happening everytime, i could import data very fast before (15k/s nodes or relationship insertion) but now it can no longer go beyond 1k nodes/s and 50-100 relationship/s.

This is my cypher command i use to import data :

```auto
PROFILE USING PERIODIC COMMIT 100
LOAD CSV WITH HEADERS FROM 'file:///exports/rel/test.csv' AS row
FIELDTERMINATOR '|'
WITH row WHERE row.END_ID IS NOT NULL AND row.START_ID IS NOT NULL
MATCH (vir:Virement_SEPA {vir_sepa_id: row.START_ID})
MATCH (rib:RIB { rib_id: row.END_ID })
MERGE (vir)-[:A_RECU]->(rib)

```

This is the PROFILE with only 100 rows :

 ![plan (1)](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/2X/e/ea0b8004443f9718f73c1b5713e139ba0a9300b1.png)

Did i do something wrong ?  
Thanks for helping

---

<div class="post-metadata">

**Author:** ![Iliasse](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/iliasse/32/9173_2.png) [@Iliasse](https://community.neo4j.com/u/Iliasse)\
**Post date:** [March 4, 2020, 3:58pm UTC](https://community.neo4j.com/t/importing-relationships-nodes-very-slow/15327/2 "2020-03-04T15:58:51Z")

</div>

I'm trying to merge my relationships with my entire file (30 millions rows) and this happened :  
At the beggining (20-30 minutes ago) i was stuck at 300-500 new relationship per second and now i can reach 15-20k new relationship per second. I don't understand what makes this difference but at least it's now importing at normal speed.

---

<div class="post-metadata">

**Author:** ![intouch\_vivek](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/intouch_vivek/32/4097_2.png) [@intouch\_vivek](https://community.neo4j.com/u/intouch_vivek)\
**Post date:** [March 4, 2020, 5:06pm UTC](https://community.neo4j.com/t/importing-relationships-nodes-very-slow/15327/3 "2020-03-04T17:06:09Z")

</div>

Had you refresh the browser before second iteration?

---

<div class="post-metadata">

**Author:** ![Iliasse](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/iliasse/32/9173_2.png) [@Iliasse](https://community.neo4j.com/u/Iliasse)\
**Post date:** [March 5, 2020, 10:47am UTC](https://community.neo4j.com/t/importing-relationships-nodes-very-slow/15327/4 "2020-03-05T10:47:13Z")

</div>

Hi Vivek, i don't remember but i think i didn't refreshed my browser before.

ps: it took about 1.5 hours to import 30 millions new relationship
