-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disappointing read performance #20
Comments
I should add:
|
Thanks for the details. It may be related to alphaHeavy/protobuf#4. RethinkDB 1.13 will deprecate the protobuf-based protocol. I don't think I will fix this issue directly, but instead switch to the new protocol when that version comes out. |
I wouldn't expect hSetBuffering h NoBuffering
setSocketOption s NoDelay 1 |
Upgrading to rethinkdb 1.15, Adding |
I did some benchmarks with my own driver (https://github.com/wereHamster/rethinkdb-client-driver). It uses the JSON API. Looking up a single empty object ( Once the object gets bigger, the lookup takes orders of magnitude longer. 30s / 10k iterations (3ms per call) and more. I stopped testing after that. I don't know whether the time is spent on the client parsing the response or in the server. |
@wereHamster Awesome. Those are the kind of times I would expect. I believe my code in |
@AtnNn could this be a bug in Network using connectTo? The mongo driver suffers from a similar lag as well and they are using connectTo from Network. It looks like @wereHamster is using createSocket for his connection. This is all just speculation right now as I have not looked into it and I could be way off. I will look into it more after the weekend. |
|
@wereHamster Thanks! Maybe I should read through the code more before speculating or commenting 😄 |
@AtnNn for the record I did try setting the socket option as @NathanHowell mentioned: setSocketOption s NoDelay 1 That didn't seem to have any effect as well. |
In a quick test, adding |
Hmm.... Maybe I did something off or wrong. |
With this change, I was able to get over 4000 reads per second on a single connection by running I've pushed my changes to master. All tests pass on GHC 7.8. I'll release this and @codedmart's other changes after testing with GHC 7.6. |
I don't think the improvement is because of the NoDelay socket option. I don't use it in my driver and it is even faster when doing the same Good job nonetheless. My web app feels quite a bit faster now. |
I did a simple read benchmark with criterion and the results are very disappointing. The numbers indicate that the driver can only sustain ~25 reads/s (or ~40ms per query). The benchmark code is here.
The hardware I was running the benchmark on is a Lenovo x220, i7-2640M 2.80GHz, 16G RAM.
The text was updated successfully, but these errors were encountered: