httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David Robinson)
Subject Apache 1.1 slowness (with fix)
Date Sun, 25 Feb 1996 16:34:00 GMT
My benchmarks of 1.1b0 suggested that it was much slower than I remembered
1.0 could be... This patch cures the problem:

  Subject: Don't flush output after headers are written if we are not doing
  Affects: http_protocol.c
  ChangeLog: Only call bflush() after sending the header if we are using
             keep-alives, to workround a netscape bug; otherwise it hurts
 Comments: Needs my other patches applied first.

My system is a SPARCclassic running Solaris 2.5, with an unloaded 10BaseT

Without the patch, the response time for a request for a tiny file (6 bytes)
was ~60ms.
With the patch, it is 29ms.

When using keepalives, there is a connection overhead of 5-10ms, with a
response time of 50 ms for each request. With the patch, the final request
has its response time reduced to 10ms.

Thus, on my system, it is faster to not use keepalives.

Interesting fact; doing the same test with the spyglass server shows that
it too flushes the output after writing the headers, and so it also has
a response time of 55 ms for each request in a keep-alive connection.
However, it has a connection overhead of > 200ms! So for a client which
doesn't support keep-alives, the time taken to service a request was
~270ms; thus Apache is now 9x faster than the spyglass server. 8-)

I seem to recall that the number of requests used in Spyglass's benchmark
was huge; if we reduce this to, 5, then Apache is still roughly twice as fast.

`fast', here, means response time measured by the client.


-------- the patch itself:
*** http_protocol.c.orig	Sun Feb 25 15:14:01 1996
--- http_protocol.c	Sun Feb 25 16:03:04 1996
*** 573,579 ****
!     bflush(r->connection->client);  /* only if kept-alive??? */
      bsetopt(fd, BO_BYTECT, &zero);
      r->sent_bodyct = 1;		/* Whatever follows is real body stuff... */
--- 573,580 ----
!     if (c->keepalive)
! 	bflush(r->connection->client);  /* For bugs in Netscape, perhaps */
      bsetopt(fd, BO_BYTECT, &zero);
      r->sent_bodyct = 1;		/* Whatever follows is real body stuff... */

View raw message