Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Sep 2000 12:24:08 -0600
From:      Warner Losh <imp@village.org>
To:        David Miller <dmiller@search.sparks.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Limits of TCP in FreeBSD kernel? 
Message-ID:  <200009231824.MAA06904@harmony.village.org>
In-Reply-To: Your message of "Sat, 23 Sep 2000 13:24:07 EDT." <Pine.BSF.4.21.0009231308370.16330-100000@search.sparks.net> 
References:  <Pine.BSF.4.21.0009231308370.16330-100000@search.sparks.net>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.21.0009231308370.16330-100000@search.sparks.net> David Miller writes:
: I tried ping -f localhost on an 800 MHz athlon, and netstat -w 1 -I lo0

ping -f doesn't use TCP at all.

: indicated about 80,000 pps.  The system was 100% busy doing this, about
: 85% system usage.

Sounds about right.  You asked ping to do as much work as it can and
it is doing it.

: I'm thinking this is probably spent largely switching
: in and out of kernel mode to a) have ping send the packet and b) respond
: to it.  If this is correct, the number of packets it could handle while
: staying within kernel mode would be considerably larger.  Or I could be
: sniffing glue and the cost of copying packets in and out would exceed that
: of context switching.

The number of packets is limited by the bandwidth of the pipe coming
into the machine, even for gigabit ethernet.  Also, larger packets
generally do better than smaller ones due to decreated interrupt
overhead.

ping -f isn't a good measure of throughput because it uses ICMP
packets and isn't coded for maximum speed.  ftp may be a better way to
estimate this, but you may need have a really large file in order to
get good measurements.  Since you are doing 5MB/s with ping's 64 byte
packets, you should likely get 50-100MB/s with TCP/IP and ftp, plus or
minus.  Make sure that the file you pick is in the buffer cache so
that you don't take the hit of reading it into RAM.  Also, you might
want to consider using the ttcp testing program to get numbers.

Since you are using the loopback device, you don't need to worry about 
a quality ethernet card, but might if you want to go external to the
box. 

: How many packets per second could I expect to get under ideal
: circumstances?

80,000 pps is a 5MB/s or 41Mb/s.  For a TCP streaming connection, you
can expect much higher data rates.  100Mb/s ethernet easily can be
saturated, while 1Gb/s ethernet can be saturated with a few tweaks
and using jumbo-frames.  Zero copy operations are important for
gigabit ethernet because the data rates are so high.  Ken Merry
<ken@plutotech.com> and others have done some work in this area.

Warner



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009231824.MAA06904>