netdev
[Top] [All Lists]

Re: sendfile+zerocopy: fairly sexy (nothing to do with ECN)

To: Ion Badulescu <ionut@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: sendfile+zerocopy: fairly sexy (nothing to do with ECN)
From: Andrew Morton <andrewm@xxxxxxxxxx>
Date: Sat, 27 Jan 2001 21:39:52 +1100
Cc: lkml <linux-kernel@xxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
References: <3A726087.764CC02E@xxxxxxxxxx> <200101271005.f0RA5DX04357@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
Ion Badulescu wrote:
> 
> 2.4.1-pre10+zerocopy, using read()/write():     18.3%-29.6% CPU         * why 
> so much variance?

The variance is presumably because of the naive read/write
implementation.  It sucks in 16 megs and writes out out again.
With a 100 megabyte file you'll get aliasing effects between
the sampling interval and the client's activity.

You will get more repeatable results using smaller files.  I'm
just sending /usr/local/bin/* ten times, with

./zcc -s otherhost -c /usr/local/bin/* -n10 -N2 -S

Maybe that 16 meg buffer should be shorter...  Yes, making it
smaller smooths things out.

Heh, look at this.  It's a simple read-some, send-some loop.
Plot CPU utilisation against the transfer size:

Size           %CPU


256             31
512             25
1024            22
2048            18
4096            17
8192            16
16384           18
32768           19
65536           21
128k            22
256k            22.5

8192 bytes is best.

I've added the `-b' option to zcc to set the transfer size.  Same
URL.

-

<Prev in Thread] Current Thread [Next in Thread>