activegraph icon indicating copy to clipboard operation
activegraph copied to clipboard

Bolt slower than http

Open eltupe opened this issue 7 years ago • 8 comments

It seems to me that bolt is significantly slower than http. I setup my test app as described in the docs:

rails new myapp -m http://neo4jrb.io/neo4j/neo4j.rb -O
cd myapp
rake neo4j:install[community-latest]
rake neo4j:start

rails generate scaffold User name:string email:string
rails s
open http://localhost:3000/users

Then i create around 10'000 users and record the loading time of the user index page with default http. I then change the protocol to bolt in /config/neo4j.yml:

development:
  type: bolt
  url: bolt://localhost:7472

Restarting the server and reloading the users/index page yields a much higher rendering time (about twice as long) using bolt.

Is this working as intended? Can you replicate this behavior? Or is my Bolt setup wrong?

Thanks and Greetings

eltupe avatar May 04 '17 09:05 eltupe

The Bolt adaptor in neo4j-core is known to be 2-3 slower than the HTTP adaptor. It's not something that I've had time to look into, unfortunately (thanks for creating an issue for it, though).

cheerfulstoic avatar May 04 '17 16:05 cheerfulstoic

Thank you for your quick reply.

So is there any advantage in using bolt? I was really looking forward to take advantage of the faster protocol with neo4jrb version 8. Are there any plans to fix this?

eltupe avatar May 04 '17 21:05 eltupe

Unfortunately I don't have the time to investigate, though I'd be willing to look over / release PRs. I think that Neo Technology might be thinking about dedicating some time to Ruby soon, which might help. I'm led to understand, though, that the python implementation of bolt is also slow relative to it's HTTP implementation (whereas other languages' bolt implementations are on-par or somewhat faster than their HTTP implementations).

I also heard that the focus on initial implementations of the bolt protocol wasn't going to be focused on performance but getting things working, but my information might be out of date there.

cheerfulstoic avatar May 05 '17 02:05 cheerfulstoic

were there any new discoveries to this matter? I am firing up a bolt query RETURN 123 just to test and I get response times starting with a range of 1 second to 1.5 seconds. Is there any way I can reduce this?

ImCarrot avatar Mar 30 '18 04:03 ImCarrot

Even with my understanding of the Bolt driver, that still seems particularly slow to me. Do you need to go over the network to access Neo4j?

I'm hoping to get some time to work on the Bolt adaptor in the next couple of weeks, so I'll keep an eye out for performance improvements.

cheerfulstoic avatar Mar 30 '18 13:03 cheerfulstoic

Hi is there any update on this issue? we are about to use neo4j and PSQL in our rails based web service but due to this slowness issue we are in plan to decouple the service and go with java web service for neo4j and rails for PSQL. Fix for this slowness issue will help us lot.

DheepakD avatar Nov 21 '19 10:11 DheepakD

@DheepakD There should not be any slowness issues with https://github.com/neo4jrb/neo4j-ruby-driver.

amitsuryavanshi avatar Nov 21 '19 14:11 amitsuryavanshi

🎉 Excited to see a Ruby gem based on seabolt! I'll have to try it soon ❤️

cheerfulstoic avatar Nov 22 '19 08:11 cheerfulstoic