-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Very slow second write to a socket #31842
Comments
Thanks, that seems to be it. I can make a PR. By the way, do you think Nagle's algorithm should be enabled or disabled by default? |
Nagle's algorithm is important for ensuring good performance when doing large numbers of small writes/reads to/from a TCP socket. The fact that it's on by default for TCP sockets in most (all?) Linux distributions is, to me, a signal that it's a sensible choice to leave it on by default in applications. The assumption made seems to be that high bandwidth usecases far outweight low latency usecases. |
…1842 ) disable_nagle was split into nagle (which enables or disables Nagle's algorithm) and quickack (which enables or disables TCP_QUICKACK on Linux systems).
Improve Nagle DocString. See also JuliaLang#31842
Improve Nagle DocString. See also #31842 --------- Co-authored-by: Elliot Saba <staticfloat@gmail.com>
I am experiencing very poor performance in a client-server application that communicates over loopback when I split a single write on the server into two separate writes to a socket. I have the following code:
I run server by calling
u_server(IPv4("127.0.0.1"), 2041)
and, in a separate Julia REPL process, I run a clientu_client(IPv4("127.0.0.1"), 2041)
. The code above has good performance, the time it takes the client to receive both bytes is on the order of 0.1ms. However, if I send the bytes separately (for example by replacingwrite(sock, [0x00, 0x00])
withwrite(sock, 0x00, 0x00)
) the time measured by the client jumps to over 40ms and is consistent across multiple runs.Version info:
The text was updated successfully, but these errors were encountered: