Code Monkey home page Code Monkey logo

Comments (3)

jexp avatar jexp commented on August 22, 2024

Test with all 2 transports

Use threadpool / fork-join-pool / parallel-stream with a sensible distribution, e.g. 90% reads and 10% writes.

Measure throughput (req/s), latency per thread count.

For example small social network:

Writes:

// create user 20%
MERGE (:User {id:{1}})
ON CREATE SET u.name = {2}, u.age={3}

// create friend relationship 80%
MATCH (u:User {id:{1}}), (f:User {id:{2}}) 
MERGE (u)-[:FRIEND]-(f);

Reads

// find user 20%
MATCH (u:User {id:{1}}) RETURN u;

// find user's friends 70%
MATCH (u:User {id:{1}})-[:FRIEND]-(f) RETURN f.id;

// suggest new friends 10%
MATCH (u:User {id:{1}})-[:FRIEND]-(f)-[:FRIEND]-(fof) 
WHERE NOT (u)-[:FRIEND]-(fof)
RETURN fof.id as fof, count(*) as score
ORDER BY score DESC LIMIT 10;

from neo4j-jdbc.

jexp avatar jexp commented on August 22, 2024

@albertodeste use this constraint as well:

CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE;

from neo4j-jdbc.

inserpio avatar inserpio commented on August 22, 2024

@albertodeste & @glaggia-larus wrote a small project for that:
https://github.com/larusba/neo4j-jdbc-performance-test.

I just add the CONSTRAINT as asked above by @jexp.

Here's the output for my macbook machine:

=========== NEO4J JDBC PERFORMANCE TEST ===========
Configuration: JDBC BOLT
Creating 2 USER_WRITER threads... DONE
Creating 8 RELATIONSHIP_WRITER threads... DONE
Creating 18 USER_READER threads... DONE
Creating 62 USER_FRIEND_READER threads... DONE
Creating 9 USER_FRIEND_SUGGESTION_READER threads... DONE
Setting up performance test...
Performance test running...
=============== PROCESSING RESULTS ================
--------------------- TOTALS ----------------------
Number of threads: 99
Queries executed: 1448788
Execution time: 200018ms
-------------- Details for thread USER_WRITER:
Cypher statement: MERGE (u:User {id:{1}}) ON CREATE SET u.name = {2}, u.age={3}
Number of threads: 2
Queries executed: 11757
Average time per query: 34ms
-------------- Details for thread RELATIONSHIP_WRITER:
Cypher statement: MATCH (u:User {id:{1}}), (f:User {id:{2}}) MERGE (u)-[:FRIEND]-(f);
Number of threads: 8
Queries executed: 36350
Average time per query: 44ms
-------------- Details for thread USER_READER:
Cypher statement: MATCH (u:User {id:{1}}) RETURN u;
Number of threads: 18
Queries executed: 286893
Average time per query: 13ms
-------------- Details for thread USER_FRIEND_READER:
Cypher statement: MATCH (u:User {id:{1}})-[:FRIEND]-(f) RETURN f.id;
Number of threads: 62
Queries executed: 970898
Average time per query: 13ms
-------------- Details for thread USER_FRIEND_SUGGESTION_READER:
Cypher statement: MATCH (u:User {id:{1}})-[:FRIEND]-(f)-[:FRIEND]-(fof) WHERE NOT (u)-[:FRIEND]-(fof)  WITH fof, count(*) as score  ORDER BY score DESC LIMIT 10 RETURN fof.id as fof, score;
Number of threads: 9
Queries executed: 142890
Average time per query: 13ms

34-44ms for writes
13ms for reads
11757 nodes created
36151 rels created
with execution time = 200sec and 100 threads

from neo4j-jdbc.

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.