[netperf-talk] Re: CPU calibration

Rick Jones rick.jones2 at hp.com
Thu Jul 12 11:52:44 PDT 2007


Brijraj Vaghani wrote:
> Thanks a lot Rick. I think the numbers make a lot of sense after using
> procstat instead of LOOPER on an embedded linux setup.
> 
> I was also curious to know if the data transfer in Netperf between
> user and kernel space is mmapapped or through data copies? This
> information would help me determine in which portion of the processor
> is spending most of its time.

Unless you run the TCP_SENDFILE test I _suspect_ the transfer is via 
data copies.  It isn't using mmap() to allocate the buffers.  Of course, 
a stack could in theory still do some sort of zero-copy behind netperf's 
back - say with copy on write or something, but I'm not sure of any 
which do these days with plain old send() calls.

Under Windows, if one sets the socket buffer size to zero (how's that 
for an obscure semantic) it will use the user's buffer directly, 
blocking in the send() call until the last byte is ACKed by the remote.

happy benchmarking,

rick jones

> 
> Thanks,
> Brijraj
> 
> On 7/9/07, Rick Jones <rick.jones2 at hp.com> wrote:
> 
>> > I reconfigured Netperf with --enable-cpuutil=procstat and executed the
>> > same test. The results look slightly different but still a little off.
>> > To process 0.3 Mpbs of data it takes 2.9% CPU. The additional 0.4% in
>> > case of LOOPER might be because of the artifacts.
>>
>> Agreed - the use of LOOPER is not without overhead.
>>
>>  > Using TOP I observed
>> > the CPU utilization of the Netserver process. It oscillates between
>> > 0.1% to 0.3%. Any ideas as to why this discrepancy?
>>
>> Well, not all the CPU consumed on behalf of netperf will be charged to
>> the netperf process.  That probably isn't all the difference though it
>> might close the gap if you look at top's report of overall CPU util.
>>
>> I suppose there is a possibility of math errors with such low CPU utils
>> - there is IIRC some integer math happening there.  You might increase
>> the traffic rate by one or two orders of magnitude and revisit the
>> comparison.
>>
>> netperf uses the stats exported via /proc/stat - I suppose that some
>> manual calculations could also be done as a sanity check of netperf's 
>> math.
>>
>> rick jones
>>
>>



More information about the netperf-talk mailing list