خرید بک لینک

Vote count: 0

We are using http end point for read queries so far and plaing to move to java bolt driver. But in initial tests it is observed that bolt driver is slower than http end point. following is the java driver code we are using.

Driver instance created at Application context level: Driver neo4jReadDriver = GraphDatabase.driver("bolt://xyz.com", AuthTokens.basic("neo4j","neo4j" ), Config.build().withMaxSessions(20).toConfig());

Application code for executing query:

    Session session = neo4jReadDriver .session();

    StatementResult result = session.run( "MATCH(p:GOE) retu count(p) as cnt");


    while ( result.hasNext() )
    {
        Record record = result.next();
        System.out.println("Total number of GOEs:"+ record.get( "cnt").asInt());

    }
    result.consume();
    session.close();
    driver.close();

This query consistently takes double the time than http endpoint. Most of the time taken at driver.getSession(). Am i doing any thing wrong here? How to get high throughput using bolt java driver with concurrent users executing the read queries?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 29 خرداد 1395 ساعت: 5:49

صفحه بندی