Closed dtzxporter closed 4 months ago
I don't have the time to look into this right now, but a few notes:
Could this be Nagle's algorithm, perhaps?
The flow is:
TcpStream
split into read/write pairs, owned by two tokio tasks (send/recv).FWIW: I don't think it's an issue with the 8 spawned tasks hammering the flume channel, because cutting out the socket yields 26million msg/s between the 'tasks' themselves, ignoring the outbound sends.
Let me know if there is any other information that would help with diagnosing this issue! I'm available to debug / do whatever, I just don't know enough about the internals at the moment to get a baseline of where to start.
Simple diagram:
Could this be Nagle's algorithm, perhaps?
Welp, that was it... setting nodelay
made the issue go away!
It's always Nagle! :)
Version List the versions of all
tokio
crates you are using. The easiest way to get this information is usingcargo tree
subcommand:1.37. I tested 1.38 as well, no change.
Platform Windows 11 64bit.
Description Seems like windows is having performance issues using TcpStream, with most of the time spent waiting on a Condvar.
I tried this code:
https://github.com/dtzxporter/hydra/tree/main/hydra-test-main https://github.com/dtzxporter/hydra/tree/main/hydra-test-client
I expected to see this happen:
Performance near 100k rps.
Instead, this happened:
2k rps performance, 99% of the time waiting on a Condvar: