httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <colm.maccartha...@heanet.ie>
Subject Re: Linux + TCP_CORK + IPv6 = Broken
Date Tue, 03 Dec 2002 21:38:08 GMT
On Mon, Dec 02, 2002 at 02:48:53PM -0500, Jeff Trawick wrote:
> Colm MacCarthaigh <colm.maccarthaigh@heanet.ie> writes:
> 
> > Linux (2.4.18 and 2.4.19, for me anyway) with apache versions
> > 2.0.40 to 2.0.43 (that I've tested anyways) is broken with
> > TCP_CORK and IPv6. Bizarrely v6 requests will work the first
> > few times and then start failing, typically you just wont get
> > a response from the server. Though strace shows that it did
> > try to send one.
> > 
> > Anyway, disabling TCP_CORK fixes it and it works fine again,
> > useful info for anyone running IPv6, because believe me, it
> > took me all morning to figure out what the hell was going on.
> > 
> > Might be worth adding a --disable-tcp-cork option to ./configure
> > for convienence :-)
> 
> If you have time, can you see if the existing "--disable-sendfile"
> configure option gets rid of the bogosity too?  

Sure thing, I've tested it and it doesnt have any affect. The
problem is still present when I use --disable-sendfile . I've
got some more detail on the problem anyway, the problem does
not occur when you connect over anything that routes via loopback.

So you if connect from ::1 or the public v6 address, but from
the local machine, you won't see the problem. It only shows 
itself when connecting from a v6 address on a different host.

I guess linux is different about TCP_CORK over loopback. Just
to make sure it wasnt a network driver issue, I tested it on
two different servers. One using the broadcom bcm5700 driver,
and one using the Intel e1000 driver. Same problem. 

You only see the problem on the second attempt to retreive
the URI from an IP address, the first time will be successful
and then the second time won't. Which really confuses the
hell out of me. 

To see the problem, you need to be trying to retrieve a 
page that is it least 256 bytes long, 255 and you won't get it, eg:

[ start apache ]

# dd bs=1 count=255 if=/dev/zero of=index.html
[ retrieve once: successful ]
[ retrieve again: successful ]

[ kill apache ; start apache ]

# dd bs=1 count=256 if=/dev/zero of=index.html
[ retrieve once: successful ]
[ retrieve again: failed ]

> If you're running code
> after 2.0.43, you can add "EnableSendfile Off" to your config for
> "<Directory />" to get the same effect.  If we know if this does the
> trick, at least we have a work-around that doesn't require patches to
> Apache or APR.  Presumably --disable-ipv6 isn't a good work-around :)

I havnt tested from CVS just yet (my current CVS tree is full of patches
for different things), but from looking at the APR source, I don't see
a difference.

> Perhaps what is needed is
> 
>   --disable-ipv6-tcp-cork
> 
> to no-op the socket option for IPv6 traffic only, since disabling it
> altogether is a performance problem for IPv4.

Definitely useful, the current status is broken :) I'm writing a patch
right now for our servers, we run v6 *everywhere* now. (actually for
the intrested, http://ftp.heanet.ie/ went over the 1% IPv6/IPv4 usage 
last week). 

> If we knew what Linux kernels were broken* then this could be handled
> automatically at configure time, at least for those people not using
> binary builds.
> 
> *assuming that it is Linux which is broken :)

That's my next round of tests, for now , I'm getting everything with
Apache working. 

-- 
Colm MacCárthaigh

Mime
View raw message