I was perusing the Apache httpd manual online and came across a directive for enabling this. Found a description in the man page for tcp
:
TCP_DEFER_ACCEPT (since Linux 2.4)
Allow a listener to be awakened only when data arrives on the
socket. Takes an integer value (seconds), this can bound the
maximum number of attempts TCP will make to complete the
connection. This option should not be used in code intended
to be portable.
Then I found this article but I'm still unclear what kind of workloads this would be useful for. I'm assuming that if httpd
has an option specifically for this, it must have some relevance to web servers. I'm also assuming from the fact it's an option and not just how httpd
does network connections, that there are use cases where you want it and others where you don't.
Even after reading the article, I'm unclear on what the advantage to waiting for the three way handshake to complete would be. It would seem advantageous to ensure it's not going to need to swap-in the relevant httpd
instance by doing so while the handshake is still going on instead of potentially causing that delay after a connection is formed.
For the article, it would also seem to me that no matter the TCP_DEFER_ACCEPT
status of a socket, you're still going to need four packets (handshake then data in each case). I don't know how they get the count down to three, nor how that provides a meaningful enhancement.
So my question is basically: Is this just an old obsolete option or is there an actual use case for this option?