You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Ames <gr...@remulak.net> on 2005/06/24 22:39:25 UTC

TCP_CORK broken on Linux 2.6?

I noticed that multiple packets are being sent to the network when one would do 
on a couple of Linux 2.6.x boxes.  one is SuSE SLES 9, the other is RHEL 4.  the 
first packet is all the HTTP headers, the second is the body/file.  strace 
http://people.apache.org/~gregames/rhel4.cork.strace reveals that httpd is 
issuing the correct setsockopt()s to enable/disable TCP_CORK.  no such problem 
seen on 2.4 kernels.

here is a packet trace in pcap/tcpdump binary format 
http://people.apache.org/~gregames/rhel4.cork.tcpdump

Nivedita, are you aware of any bugs like this?

if you want to try this with Apache 2.x, use a file that's bigger than 256 bytes 
so that core_output_filter will use sendfile, but small enough so that the HTTP 
headers + file will fit into one ethernet packet.

Greg


Re: TCP_CORK broken on Linux 2.6?

Posted by Nivedita Singhvi <ni...@us.ibm.com>.
Greg Ames wrote:

> I noticed that multiple packets are being sent to the network when one 
> would do on a couple of Linux 2.6.x boxes.  one is SuSE SLES 9, the 
> other is RHEL 4.  the first packet is all the HTTP headers, the second 
> is the body/file.  strace 
> http://people.apache.org/~gregames/rhel4.cork.strace reveals that httpd 
> is issuing the correct setsockopt()s to enable/disable TCP_CORK.  no 
> such problem seen on 2.4 kernels.
> 
> here is a packet trace in pcap/tcpdump binary format 
> http://people.apache.org/~gregames/rhel4.cork.tcpdump
> 
> Nivedita, are you aware of any bugs like this?
> 
> if you want to try this with Apache 2.x, use a file that's bigger than 
> 256 bytes so that core_output_filter will use sendfile, but small enough 
> so that the HTTP headers + file will fit into one ethernet packet.

Not that I'm aware of, but on the other hand, this
code has almost entirely been rewritten since then.

I'll look into it some more...

thanks,
Nivedita



Re: TCP_CORK broken on Linux 2.6?

Posted by Paul Querna <ch...@force-elite.com>.
Greg Ames wrote:

> I noticed that multiple packets are being sent to the network when one 
> would do on a couple of Linux 2.6.x boxes.  one is SuSE SLES 9, the 
> other is RHEL 4.  the first packet is all the HTTP headers, the second 
> is the body/file.  strace 
> http://people.apache.org/~gregames/rhel4.cork.strace reveals that 
> httpd is issuing the correct setsockopt()s to enable/disable 
> TCP_CORK.  no such problem seen on 2.4 kernels.
>
> here is a packet trace in pcap/tcpdump binary format 
> http://people.apache.org/~gregames/rhel4.cork.tcpdump
>
> Nivedita, are you aware of any bugs like this?
>
> if you want to try this with Apache 2.x, use a file that's bigger than 
> 256 bytes so that core_output_filter will use sendfile, but small 
> enough so that the HTTP headers + file will fit into one ethernet packet.
>
> Greg

FWIW, I just tested this out on FreeBSD 6.0-CURRENT and 2.1.6, and it 
behaves correctly. It sends the headers in the same packet as the 
Sendfile()'ed data. Sure sounds like a Linux specific issue.

-Paul