httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: NO_WRITEV
Date Fri, 19 Nov 1999 19:12:21 GMT
writev() allows us to reduce the number of packets on the network.

on linux we could use TCP_CORK and get the same effect with less code...
too bad linux is the only unix so far with this nice functionality.  
TCP_CORK is like the "other useful" setting other than nagle turned on...
with TCP_CORK, the kernel flushes any packets which fill an entire frame,
but holds partial packets until the socket is close()d or the cork is
removed.  in this way you can do multiple smaller write()s (or a write()
and a sendfile()) without causing small packets to go on the wire.

writev() may consume a small amount more cpu on the server, but it's my
opinion that this is a fine price to pay for fewer packets on the wire.

if you do choose to benchmark it, be sure to use slow modem clients, and
not fast lan clients... and give strong consideration to using client
latency as your metric rather than server cpu.


On Fri, 19 Nov 1999, Eli Marmor wrote:

> Hello,
> Is there any benchmark or statistics about how faster is Apache with
> writev in comparison to without it?  (i.e. a normal compilation under
> a platform supporting writev, vs. a compilation with "-DNO_WRITEV").
> If there is no official benchmark, can anybody estimate the difference
> (in percents) under a typical use of Apache?  Does it depend on the
> type of use (static pages vs. dynamic, SSI and other parsings vs. one
> block, etc.)?  Or the other bottlenecks? (it makes sense that when
> your connection to the client is slow, you will not notice the
> difference between writing 2 buffers in two system calls or in one).
> If there is a big difference, does it mean that Apache for non-writev 
> platforms (such as SCO, BeOS and Tandem) is slower and that these
> platforms are not recommended for Apache users?
> On the other hand, if the difference is very small (let's say lower
> than 1%), maybe the benefits don't deserve the price (a much more
> complex code, especially when the non-writev code must be supported
> also in the future because of the non-writev platforms).
> -- 
> Eli Marmor

View raw message