Comments (3)
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.
@albertodeste use this constraint as well:
CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE;
from neo4j-jdbc.
@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)
- Feature: Connection lifetime
- Add support for quantified comparison predicates
- Add support for row value expression predicands HOT 2
- Add integration tests HOT 2
- Implement some test / report that checks which jOOQ API / Cypher DSL API is already covered by tests HOT 2
- Add support for predicates / operators HOT 7
- Add support for expressions HOT 1
- Add support for DML statements HOT 1
- Inserts can only be translated into node creation, not relationships.
- Add support for `java.sql.Connection#setNetworkTimeout` HOT 1
- Add more detailed information to the (bolt) user-agent
- Implement an internal `Bookmarkmanager`
- Feature: Make database metadata pluggable, too.
- Feature: Add BOM project.
- Refactor: Remove trailing dots from exception messages.
- Stubkit tests fails if another database is running on localhost:7687
- Add support for alternate authentication methods.
- qStudio - SQL GUI support
- Enhance the raw config passed to the translators to contain the full, merged but unprocessed config.
- `SELECT DISTINCT` Translation in SQL to Cypher 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 neo4j-jdbc.