-
Notifications
You must be signed in to change notification settings - Fork 13
Strange behavior when reusing connection #17
Comments
Have you tried to disable Nagle algorithm by setting tcp_nodelay to true? |
Other programming languages have this very same problem due to how Nagle works. If it works, we should think about it. Here is a nice reading about the topic: https://www.extrahop.com/community/blog/2009/to-nagle-or-not-to-nagle-that-is-the-question/ |
My results:
|
@mauricioabreu / @hugoabonizio I was doing the same thing last night, but I was trying to measure how long it would take to have like 100_000 or 1_000_000 keys in the database. The thing is we have some consistency/concurrency issues on handling several requests. I had to test this with ruby, because I wasn't able to create many parallel tcp requests with Crystal for some reason. Take a look at the |
Interesting! I didn't know about Nagle's algorithm yet. Disabling for both client and server the performance was much better. It seems like Redis disables this by default, should we do the same? |
@hugoabonizio I don't know. I suck at TCP but it is worth a try. :) @marceloboeira what is this "consistency/concurrency" problem exactly? |
@hugoabonizio gonna have a look on this, but if it increases performance and redis is doing it, probably we should! |
@mauricioabreu it seems that we are not correctly implementing the "secure" routine for the TCP connection/request handler. Please read #19 for a complete answer! |
@hugoabonizio will you handle the Nagle's thing? cause I would like to try solving the concurrency problems yet it will take me a while. |
@marceloboeira OK! |
I'm getting a strange result when benchmarking BoJack Client, the performance when I reuse the same TCPSocket is much worse than opening a new one for each command. The code is here.
I noticed that @marceloboeira is making some tests on branch
benchmarks
, are you having the same problem?The text was updated successfully, but these errors were encountered: