TCP_CORK questions
From: Mihai Maruseac <hidden>
Date: 2011-11-02 09:43:28
Hi, We are using TCP_CORK with TCP_NODELAY. We are setting TCP_NODELAY first and then setting TCP_CORK before sending a bunch of data buffers. After sending all the buffers we are clearing TCP_CORK. The expectation -- as per manpage -- is that when TCP_CORK is set small data packets will not be sent. When TCP_CORK is removed it will immediately send out the remaining data even if the remaining amount is very small. However, this is not the observed behavior. Small packets are sent at an approximatively constant rate. Digging further into the manpage for tcp we saw that there is a 200ms ceiling on the time for which the output is corked. Can we change this limit somehow? Ideally, in our case we would like to have userspace mark a socket such that it will only send full packets as long as it is marked, even if the completion comes after a long time. Digging into tcp.c when the socket options are set, we found that if when setting TCP_NAGLE_CORK we also disable TCP_NAGLE_PUSH the code works as intended. Is this the right way to solve it? Code comments suggest that disabling this flag there has no effect. Thanks, Mihai