setsockopt TCP_NODELAY on mushclient's TCP

Posted by Khannon on Fri 29 Apr 2022 08:35 PM — 3 posts, 13,021 views.

#0
I've used software called Leatrix Latency Fix(LLF) since I started using Mushclient, during my PC upgrade in 2016, I noticed how MushClient was somehow slow compared to before (with an older PC that had LLF installed). Couldn't figure it out for a very long time, until I remembered LLF.

Also going to post this from Fiendish:

Please drop a suggestion in the mushclient forum for Nick to:

"setsockopt TCP_NODELAY mushclient's TCP sockets because mushclient is unlikely to benefit from nagle's algorithm."

Edit: "and maybe also TCP_QUICKACK"
Amended on Sat 30 Apr 2022 02:54 PM by Khannon
Australia Forum Administrator #1
I'm having a few problems with my build environment (it's still Windows XP) so I'll see if my colleague Fiendish can do it for you. :)
USA Global Moderator #2
I have a test build that sets TCP_NODELAY (the download link should be available for one month)
https://ci.appveyor.com/api/buildjobs/5jaqk7418lld82fh/artifacts/MUSHclient.exe

It does not set SIO_TCP_SET_ACK_FREQUENCY (the windows equivalent of TCP_QUICKACK) because that is not well documented and less portable and therefore harder for me to assess. But here is how cygwin does that flag for future reference: https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=ee2292413792f0360d357bc200c5e947eae516e6

John Nagle appears to think that disabling ACK delays systemwide is almost always a good idea (https://news.ycombinator.com/item?id=10608356). I'm not sure why Microsoft enables ACK delays then, but the registry entry for toggling it globally appears to be https://docs.microsoft.com/en-US/troubleshoot/windows-server/networking/registry-entry-control-tcp-acknowledgment-behavior (set the TcpAckFrequency value to 1). If Nagle thinks it's a good idea, I might see if I can just make my installer flip that registry flag.

Maybe people can test these things out independently because I don't have a Windows setup myself to test with.