Mixing sendfile, tcp_nodelay and tcp_nopush illogical?
rokcarl opened this issue · 2 comments
The following article suggests that mixing sendfile
, tcp_nodelay
and tcp_nopush
makes no sense.
I'd love to hear your thoughts on this and can really many of the resources be wrong about it?
Hi @rokcarl - I think it's advocating for all three flags simultaneously.
When set indicates to always queue non-full frames. Later the user clears this option and we transmit any pending partial frames in the queue. This is meant to be used alongside sendfile() to get properly filled frames when the user (for example) must write out headers with a write() call first and then use sendfile to send out the data parts. TCP_CORK can be set together with TCP_NODELAY and it is stronger than TCP_NODELAY.
I read the article differently.
Either way, I'm not convinced by the article, especially after reading Nginx High Performance . For my use-case as a reverse proxy, just setting tcp_nodelay
worked fine and the other two switches yielded no improvements, as expected.