0

Does setting TCP_NODELAY prevent auto corking? Is there a way to turn off auto corking on a per socket basis?

JasonN
  • 1,339
  • 1
  • 15
  • 27
  • @SteffenUllrich No. That is about explicit TCP_CORK. Autocorking is done when TCP_CORK isn't specified but the kernel detect rapid writes before the skbuf has left and holds up following outbound packets, but the documentation is a little fuzzy. – JasonN Mar 20 '22 at 10:18
  • Are you on Linux or macOS? Do you have any code you've tried already? – drewster Mar 28 '22 at 16:12
  • 1
    @drewster Take a look at the tags. OP is asking about Linux – Halo Mar 31 '22 at 19:43

1 Answers1

3

Taking a look at this Stack Overflow post on what autocorking is, we can see:

...so it would still work even when TCP_NODELAY option is set.

Other than that, we have this conversation which states:

Lets wait the end of 3.14 dev cycle before considering this patch.

So, to answer your original question, setting TCP_NODELAY does not prevent autocorking. As of turning off autocorking, this post on Unix might help you.

Short answer: tcp_nagle_check() in net_ipv4_tcp_output.c

pppery
  • 3,731
  • 22
  • 33
  • 46
Halo
  • 1,730
  • 1
  • 8
  • 31
  • I don't undersand how that bottom link says anything about turning aotucork off. And the link it goes to doesn't say much about disabling it either. I find it rather obnoxious that such potentially performance impacting change could be installed with no per socket way to disable it. – JasonN Apr 06 '22 at 11:03