httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <>
Subject Re: TCP_CORK in Linux 2.6: not broken, but it doesn't work with TCP_NODELAY
Date Mon, 22 Aug 2005 13:52:38 GMT
On Sun, Aug 21, 2005 at 04:25:19PM -0700, Brian Pane wrote:
> I've attached my test program in case it's useful to others.  It's  
> run as
>   sendfile_test [--cork] [--nodelay] [--nonblock] filename  
> listener_port_number.

This is rather useful, thanks Brian.

I think you're missing the fact that 2.0 never actually tries to enable 
both TCP_CORK *and* TCP_NODELAY - this wasn't possible with a 2.4 
kernel, the second setsockopt call would fail.  APR knows not to try 
this and toggles NODELAY off when CORK is enabled.

With the FC4 2.6.12-ish kernel I am seeing:

 - stuff sent by httpd fails to cork properly; partial frames are sent 
... i.e. what Greg reported.

 - stuff sent by your test case *does* get corked properly; the partial 
header frame is suppressed; using "--cork --nonblock", which *should* be 
equivalent to what httpd does.

so I think there is something subtle here.

Comments in the 2.6 kernel source imply that TCP_CORK and TCP_NODELAY 
should actually be usable together than that TCP_CORK would trump 
TCP_NODELAY.  But this isn't what httpd is trying, so maybe should be 
treated as a separate issue for now.


View raw message