You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/01/28 01:28:38 UTC

pipelining and chunking

So Henrik and I have concluded that the problem is in the libwww library
and not in Apache.  He's working on that and will re-do the benchmarks
when he's got it fixed.

In the meanwhile, I hope to get a chance later this week to use the libwww
robot to test chunking.  I'd like to implement the performance tweak I was
talking about, is there any chance of it getting into 1.2?  Here's the
outline:

- add char *chunk_header to the buff structure.  If non-null then this points
  to the first byte of a chunk header in the buffer.  This is set by the
  switch to chunking, and at that time enough space is reserved for the
  header (you know how big it'll be at that time).  Since the chunk trailer
  requires two bytes I'll also decrease bufsiz by two at this time (or
  implement some other kludge).

- when flushing the buffer, twiddle chunk_header if required, tack on the
  chunk trailer, flush away.  Start off a fresh buffer with a new
  chunk_header, and outcnt set appropriately.

This essentially eliminates all the bflush()s that we have left.  It's
not as elegant as layered i/o, but it should do the job.

Dean


Re: pipelining and chunking

Posted by Dean Gaudet <dg...@arctic.org>.
I'm pretty sure he removed the bflush().  I actually had to go through
that step (or the converse, adding bflush) at some point while debugging
it.

Dean

On Mon, 27 Jan 1997, Alexei Kosut wrote:

> On Mon, 27 Jan 1997, Dean Gaudet wrote:
> 
> > On Mon, 27 Jan 1997, Alexei Kosut wrote:
> > > I'm still a bit unclear on this; on
> > > http://www.w3.org/pub/WWW/Protocols/HTTP/Performance/Apache.html, it
> > > says "a multiplum of 4 bytes are lost". You are now saying that those
> > > bytes are in fact not lost, but simply not read by libwww due to it
> > > being buggy?
> > 
> > That appears to be the case.  I didn't observe any lost data on the wire. 
> > Henrik is looking into libwww now.  He seems to think it's libwww as well. 
> 
> Okay; I'm happy now, then.
> 
> But a question: The version of Apache (1.2b1) flushed after each
> response was sent. It seems unlikely then that a packet would have
> ended with just the first few bytes of the next response; it would
> have only had those few bytes in it. Did Henrik remove the bflush()
> to do his test, or is this one of those random things?
> 
> -- 
> ________________________________________________________________________
> Alexei Kosut <ak...@nueva.pvt.k12.ca.us>      The Apache HTTP Server
> URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/
> 
> 


Re: pipelining and chunking

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Mon, 27 Jan 1997, Dean Gaudet wrote:

> On Mon, 27 Jan 1997, Alexei Kosut wrote:
> > I'm still a bit unclear on this; on
> > http://www.w3.org/pub/WWW/Protocols/HTTP/Performance/Apache.html, it
> > says "a multiplum of 4 bytes are lost". You are now saying that those
> > bytes are in fact not lost, but simply not read by libwww due to it
> > being buggy?
> 
> That appears to be the case.  I didn't observe any lost data on the wire. 
> Henrik is looking into libwww now.  He seems to think it's libwww as well. 

Okay; I'm happy now, then.

But a question: The version of Apache (1.2b1) flushed after each
response was sent. It seems unlikely then that a packet would have
ended with just the first few bytes of the next response; it would
have only had those few bytes in it. Did Henrik remove the bflush()
to do his test, or is this one of those random things?

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


Re: pipelining and chunking

Posted by Dean Gaudet <dg...@arctic.org>.
On Mon, 27 Jan 1997, Alexei Kosut wrote:
> I'm still a bit unclear on this; on
> http://www.w3.org/pub/WWW/Protocols/HTTP/Performance/Apache.html, it
> says "a multiplum of 4 bytes are lost". You are now saying that those
> bytes are in fact not lost, but simply not read by libwww due to it
> being buggy?

That appears to be the case.  I didn't observe any lost data on the wire. 
Henrik is looking into libwww now.  He seems to think it's libwww as well. 

Dean


Re: pipelining and chunking

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Mon, 27 Jan 1997, Dean Gaudet wrote:

> There weren't any missing bytes.  libwww was choking up on a response
> after a response which had the "HTTP/1.1 200 OK\r\n" header split across a
> packet boundary.  Apparently it was a bug introduced during the addition
> of pipelining to the library. 

I'm still a bit unclear on this; on
http://www.w3.org/pub/WWW/Protocols/HTTP/Performance/Apache.html, it
says "a multiplum of 4 bytes are lost". You are now saying that those
bytes are in fact not lost, but simply not read by libwww due to it
being buggy?

> > I'm still not quire sure exactly what you mean by all this. I'd be
> > much happier if I could see a patch.
> 
> Ok I'll whip up a patch later this week.

Thanks.

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


Re: pipelining and chunking

Posted by Dean Gaudet <dg...@arctic.org>.
On Mon, 27 Jan 1997, Alexei Kosut wrote:

> On Mon, 27 Jan 1997, Dean Gaudet wrote:
> 
> > So Henrik and I have concluded that the problem is in the libwww library
> > and not in Apache.  He's working on that and will re-do the benchmarks
> > when he's got it fixed.
> 
> So the missing bytes are libwww's fault, not Apache's? Or is this
> talking about something else?

There weren't any missing bytes.  libwww was choking up on a response
after a response which had the "HTTP/1.1 200 OK\r\n" header split across a
packet boundary.  Apparently it was a bug introduced during the addition
of pipelining to the library. 

> I'm still not quire sure exactly what you mean by all this. I'd be
> much happier if I could see a patch.

Ok I'll whip up a patch later this week.

Dean


Re: pipelining and chunking

Posted by Alexei Kosut <ak...@nueva.pvt.k12.ca.us>.
On Mon, 27 Jan 1997, Dean Gaudet wrote:

> So Henrik and I have concluded that the problem is in the libwww library
> and not in Apache.  He's working on that and will re-do the benchmarks
> when he's got it fixed.

So the missing bytes are libwww's fault, not Apache's? Or is this
talking about something else?

> In the meanwhile, I hope to get a chance later this week to use the libwww
> robot to test chunking.  I'd like to implement the performance tweak I was
> talking about, is there any chance of it getting into 1.2?  Here's the
> outline:

Probably there is (a chance).

> - add char *chunk_header to the buff structure.  If non-null then this points
>   to the first byte of a chunk header in the buffer.  This is set by the
>   switch to chunking, and at that time enough space is reserved for the
>   header (you know how big it'll be at that time).  Since the chunk trailer
>   requires two bytes I'll also decrease bufsiz by two at this time (or
>   implement some other kludge).
> 
> - when flushing the buffer, twiddle chunk_header if required, tack on the
>   chunk trailer, flush away.  Start off a fresh buffer with a new
>   chunk_header, and outcnt set appropriately.
> 
> This essentially eliminates all the bflush()s that we have left.  It's
> not as elegant as layered i/o, but it should do the job.

I'm still not quire sure exactly what you mean by all this. I'd be
much happier if I could see a patch.

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