Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-04-2019 09:22 AM
I was wondering how is the concurrent performance of neo4j.
My python test code as followed:
from neo4j import GraphDatabase
import datetime
import threading
neo4j_db = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "password"))
def get_count_r(tx):
query = """
MATCH ()-[r]-()
RETURN COUNT(r)
"""
return tx.run(query)
def thread_as_user():
start_time = datetime.datetime.now()
with neo4j_db.session() as session:
the_result_data = session.read_transaction(get_count_r)
end_time = datetime.datetime.now()
print(end_time - start_time, the_result_data)
for i in range(100):
t = threading.Thread(target=thread_as_user)
t.start()
The code is basically to simulate a hundred users to access neo4j database.
The result as followed:
Thanks,
Regards
All the sessions of the conference are now available online