Netdev List
 help / color / mirror / Atom feed
From: Marc Herbert <marc.herbert@free.fr>
To: netdev@oss.sgi.com
Subject: TxDescriptors -> 1024 default. Please not for every NIC!
Date: Sat, 15 May 2004 14:14:26 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0405151354220.9894@fcat> (raw)
In-Reply-To: <OF72607111.CD0234C8-ON85256DA1.0068861B-86256DA1.0068FF60@us.ibm.com>

On Sun, 14 Sep 2003, Ricardo C Gonzalez wrote:

> David Miller wrote:
>
> >Back to the main topic, maybe we should set dev->tx_queue_len to
> >1000 by default for all ethernet devices.
>
>
> I definately agree with setting the dev->tx_queue_len to 1000 as a default
> for all ethernet adapters. All adapters will benefit from this change.
>

<http://oss.sgi.com/projects/netdev/archive/2003-09/threads.html#00247>

Sorry to exhume this discussion but I only recently discovered this
change, the hard way.

I carefully read this old thread and did not grasp _every_ detail, but
there is one thing that I am sure of: 1000 packets @ 1 Gb/s looks
good, but on the other hand, 1000 full-size Ethernet packets @ 10 Mb/s
are about 1.2 seconds long!

Too little buffering means not enough dampering effect, which is very
important for performance in asynchronous systems, granted. However,
_too much_ buffering means too big and too variable latencies. When
discussing buffers, duration is very often more important than size.
Applications, TCP's dynamic (and kernel dynamics too?) do not care
much about buffer sizes, they more often care about latencies (and
throughput, of course). Buffers sizes is often "just a small matter of
implementation" :-) For instance people designing routers talk about
buffers in _milliseconds_ much more often than in _bytes_ (despite the
fact that their memories cost more than in hosts, considering the
throughputs involved).

100 packets @ 100 Mb/s was 12 ms. 1000 packets @ 1 Gb/s is still
12 ms. 12 ms is great. It's a "good" latency because it is the
order of magnitude of real-world constants like:  comfortable
interactive applications, operating system sheduler granularity or
propagation time in 2000 km of cable.

But 1000 packets @ 100 Mb/s is 120 ms and is neither very good nor
very useful anymore. 1000 packets @ 10 Mb/s is 1.2 s, which is
ridiculous. It does mean that, when joe user is uploading some big
file through his cheap Ethernet card, and that there are no other
bottleneck/drops further in the network, every concurrent application
will have to wait 1.2 s before accessing the network!
 It this hard to believe for you, just make the test yourself, it's
very easy: force one of you NICs to 10Mb/s full duplex, txqueuelen
1000 and send a continuous flow to a nearby machine. Then try to ping
anything.
 Imagine now that some packet is lost for whatever reason on some
_other_ TCP connection going through this terrible 1.2 s queue. Then
you need one SACK/RTX extra round trip time to recover from it: so
it's now _2.4 s_ to deliver the data sent just after the dropped
packet...  Assuming of course TCP timers do not become confused by
this huge latency and probably huge jitter.

And I don't think you want to make fiddling with "tc" mandatory for
joe user. Or tell him: "oh, please just 'ifconfig txqueuelen 10', or
buy a new Ethernet card".

I am unfortunately not familiar with this part of the linux kernel,
but I really think that, if possible, txqueuelen should be initialized
at some "constant 12 ms" and not at the "1000 packets" highly variable
latency setting. I can imagine there are some corner cases, like for
instance when some GEth NIC is hot-plugged into a 100 Mb/s, or jumbo
frames, but hey, those are corner cases : as a first step, even a
simple constant-per-model txqueuelen initialization would be already
great.

Cheers,

Marc.


PS: one workaround for joe user against this 1.2s latency would be to
keep his SND_BUF and number of sockets small. But this is poor.


-- 
"Je n'ai fait cette lettre-ci plus longue que parce que je n'ai pas eu
le loisir de la faire plus courte." -- Blaise Pascal

  parent reply	other threads:[~2004-05-15 12:14 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-09  3:14 [e1000 2.6 10/11] TxDescriptors -> 1024 default Feldman, Scott
2003-09-11 19:18 ` Jeff Garzik
2003-09-11 19:45   ` Ben Greear
2003-09-11 19:59     ` Jeff Garzik
2003-09-11 20:12     ` David S. Miller
2003-09-11 20:40       ` Ben Greear
2003-09-11 21:07         ` David S. Miller
2003-09-11 21:29           ` Ben Greear
2003-09-11 21:29             ` David S. Miller
2003-09-11 21:47               ` Ricardo C Gonzalez
2003-09-11 22:00                 ` Jeff Garzik
2003-09-11 22:15               ` Ben Greear
2003-09-11 23:02                 ` David S. Miller
2003-09-11 23:22                   ` Ben Greear
2003-09-11 23:29                     ` David S. Miller
2003-09-12  1:34                     ` jamal
2003-09-12  2:20                       ` Ricardo C Gonzalez
2003-09-12  3:05                         ` jamal
2003-09-13  3:49                       ` David S. Miller
2003-09-13 11:52                         ` Robert Olsson
2003-09-15 12:12                           ` jamal
2003-09-15 13:45                             ` Robert Olsson
2003-09-15 23:15                               ` David S. Miller
2003-09-16  9:28                                 ` Robert Olsson
2003-09-14 19:08                         ` Ricardo C Gonzalez
2003-09-15  2:50                           ` David Brownell
2003-09-15  8:17                             ` David S. Miller
2004-05-15 12:14                           ` Marc Herbert [this message]
2004-05-19  9:30                             ` TxDescriptors -> 1024 default. Please not for every NIC! Marc Herbert
2004-05-19 10:27                               ` Pekka Pietikainen
2004-05-20 14:11                                 ` Luis R. Rodriguez
2004-05-20 16:38                                   ` [Prism54-devel] " Jean Tourrilhes
2004-05-20 16:45                                     ` Tomasz Torcz
2004-05-20 17:13                                       ` zero copy TX in benchmarks was " Andi Kleen
2004-05-19 11:54                               ` Andi Kleen
     [not found] <C925F8B43D79CC49ACD0601FB68FF50CDB13D3@orsmsx408>
2004-06-02 19:14 ` Marc Herbert
2004-06-02 19:49   ` Cheng Jin
2004-06-05 14:37     ` jamal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0405151354220.9894@fcat \
    --to=marc.herbert@free.fr \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox