You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by John Heidemann <jo...@ISI.EDU> on 1996/07/11 02:27:18 UTC

Re: performance ``bugs'' in apache-1.1b4's P-HTTP

On Wed, 10 Jul 1996 19:01:52 EDT, Robert S. Thau wrote: 
>One thing which it would be helpful to know is how much the second
>tweak to the server (disabling the Nagle algorithm) helps on its own
>(and whether it does anything at all, perhaps by allowing the window
>to open up a bit wider, to cure the effects of problem one, the MIME
>header partial packet --- probably not, I know, but perhaps it's worth
>asking).

I believe that the first problem causes a delayed-ack stall when
opening the congestion window at the beginning of a P-HTTP request
when the connection window is <= 2 segments.  The second problem
causes a delayed-ack stall at the end of a P-HTTP request when packet
lengths meet the restrictions described in the paper.
Either stall costs ~100ms (on average).  (In my tests, it actually
costs ~170ms consistenly because the client and server sync on the
delayed ack timer.)

If my analysis is correct, than the Nagle algorithm is not involved in
the first problem.  It's a congestion window problem.  In this case,
fixing only the second problem should leave the first stall and a
~100ms performance hit whenever the connection window must open from
<= 2 segments.  For people connecting at >=128Kbps speeds this cost
begins to be noticable (for the workload I give).  At slower speeds
than this the stall will be lost in transfer time.

Alexei Kosut wrote:
>... Unfortunately, Netscape Navigator has a rather serious bug in its
>Keep-Alive implementation - if the end of the file is in the same read as
>the headers, it will not recognize properly that it is dealing with a
>persistent connection, and the connection will hang, waiting for a close.
>
>... One
>option is, I suppose, to only do the fflush() for files less than whatever
>Netscape's read buffer size is (I tested for this a couple month ago when
>I first wrote the keep-alive code, but I now forget - it was 256 or
>1024 bytes, or something of the sort).

If Alexei's description of the Netscape problem is correct, than his
proposed work-around (find the buffer size and only flush for files
smaller than that) sounds ideal.

What versions of Netscape exhibit the problem?  If they include 2.x
(i.e., any non-beta versions), then Apache certainly must work around
the problem.  If the problem occurs only in 3.0bX versions (for X < 5)
then it might be feasible to tell people to upgrade.  (People using
betas are presumably motivated and knowledgeable enough to upgrade,
while most people use production software and won't upgrade unless you
put a gun to their head.)

Another option would be to have Apache detect browser versions and
work-around the bug only when necessary.  It seems a shame to clutter
up Apache with such code, but it may be a reasonable engineering
solution.

   -John Heidemann
    USC/ISI


Re: performance ``bugs'' in apache-1.1b4's P-HTTP

Posted by Alexei Kosut <ak...@organic.com>.
On Wed, 10 Jul 1996, John Heidemann wrote:

> What versions of Netscape exhibit the problem?  If they include 2.x
> (i.e., any non-beta versions), then Apache certainly must work around
> the problem.  If the problem occurs only in 3.0bX versions (for X < 5)
> then it might be feasible to tell people to upgrade.  (People using
> betas are presumably motivated and knowledgeable enough to upgrade,
> while most people use production software and won't upgrade unless you
> put a gun to their head.)

The problem occurs with all Netscape Navigator versions, starting with the
2.0 betas and through at least 2.01 (I haven't tested it with 3.0,
actually, maybe they fixed it.)

> Another option would be to have Apache detect browser versions and
> work-around the bug only when necessary.  It seems a shame to clutter
> up Apache with such code, but it may be a reasonable engineering
> solution.

Possibly. I think at one point, before we found the fflush() solution
(which, at least, seemed clean - back when the keep-alive code was first
implemented in Apache, we were trying things like not enabling keep-alive
for small files and other stuff), we did that. I don't particuarly like
checking browser versions, though. For one thing, you catch imposters,
like Microsoft Internet Explorer, which claims to be Netscape, but isn't.

-- Alexei Kosut <ak...@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/