netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Antonio Almeida <vexwek@gmail.com>
Cc: netdev@vger.kernel.org, kaber@trash.net, davem@davemloft.net,
	devik@cdi.cz
Subject: Re: HTB accuracy for high speed
Date: Sun, 17 May 2009 22:15:28 +0200	[thread overview]
Message-ID: <20090517201528.GA8552@ami.dom.local> (raw)
In-Reply-To: <298f5c050905150749s3597328dr8dd15adbd7a37532@mail.gmail.com>

On Fri, May 15, 2009 at 03:49:31PM +0100, Antonio Almeida wrote:
> Hi!
> I've been using HTB in a Linux bridge and recently I noticed that, for
> high speed, the configured rate/ceil is not respected as for lower
> speeds.
> I'm using a packet generator/analyser to inject over 950Mpbs, and see
> what returns back to it, in the other side of my bridge. Generated
> packets have 800bytes. I noticed that, for several tc HTB rate/ceil
> configurations the amount of traffic received by the analyser stays
> the same. See this values:
> 
> HTB conf      Analyser reception
> 476000Kbit    544.260.329
> 500000Kbit    545.880.017
> 510000Kbit    544.489.469
> 512000Kbit    546.890.972
> -------------------------
> 513000Kbit    596.061.383
> 520000Kbit    596.791.866
> 550000Kbit    596.543.271
> 554000Kbit    596.193.545
> -------------------------
> 555000Kbit    654.773.221
> 570000Kbit    654.996.381
> 590000Kbit    655.363.253
> 605000Kbit    654.112.017
> -------------------------
> 606000Kbit    728.262.237
> 665000Kbit    727.014.365
> -------------------------
> 
> There are these steps and it looks like doesn't matter if I configure
> HTB to 555Mbit or to 605Mbit - the result is the same: 654Mbit. This
> is 18% more traffic than the configured value. I also realise that for
> smaller packets it gets worse, reaching 30% more traffic than what I
> configured. For packets of 1514bytes the accuracy is quiet good.
> I'm using kernel 2.6.25
> 
> My 'tc -s -d class ls dev eth1' output:
> 
> class htb 1:10 parent 1:2 rate 1000Mbit ceil 1000Mbit burst 126375b/8
> mpu 0b overhead 0b cburst 126375b/8 mpu 0b overhead 0b level 5
>  Sent 51888579644 bytes 62067679 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 653124Kbit 97656pps backlog 0b 0p requeues 0
>  lended: 0 borrowed: 0 giants: 0
>  tokens: 113 ctokens: 113
> 
> class htb 1:1 root rate 1000Mbit ceil 1000Mbit burst 126375b/8 mpu 0b
> overhead 0b cburst 126375b/8 mpu 0b overhead 0b level 7
>  Sent 51888579644 bytes 62067679 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 653123Kbit 97656pps backlog 0b 0p requeues 0
>  lended: 0 borrowed: 0 giants: 0
>  tokens: 113 ctokens: 113
> 
> class htb 1:2 parent 1:1 rate 1000Mbit ceil 1000Mbit burst 126375b/8
> mpu 0b overhead 0b cburst 126375b/8 mpu 0b overhead 0b level 6
>  Sent 51888579644 bytes 62067679 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 653124Kbit 97656pps backlog 0b 0p requeues 0
>  lended: 0 borrowed: 0 giants: 0
>  tokens: 113 ctokens: 113
> 
> class htb 1:108 parent 1:10 leaf 108: prio 7 quantum 1514 rate
> 555000Kbit ceil 555000Kbit burst 70901b/8 mpu 0b overhead 0b cburst
> 70901b/8 mpu 0b overhead 0b level 0
>  Sent 51888579644 bytes 62067679 pkt (dropped 27801917, overlimits 0 requeues 0)
>  rate 653124Kbit 97656pps backlog 0b 0p requeues 0
>  lended: 62067679 borrowed: 0 giants: 0
>  tokens: -798 ctokens: -798
> 
> As you can see, class htb 1:108 rate's is 653124Kbit! Much bigger that
> it's ceil.
> 

Here is some additional explanation. It looks like these rates above
500Mbit hit the design limits of packet scheduling. Currently used
internal resolution PSCHED_TICKS_PER_SEC is 1,000,000. 550Mbit rate
with 800byte packets means 550M/8/800 = 85938 packets/s, so on average
1000000/85938 = 11.6 ticks per packet. Accounting only 11 ticks means
we leave 0.6*85938 = 51563 ticks per second, letting for additional
sending of 51563/11 = 4687 packets/s or 4687*800*8 = 30Mbit. Of course
it could be worse (0.9 tick/packet lost) depending on packet sizes vs.
rates, and the effect rises for higher rates.

Jarek P.

  parent reply	other threads:[~2009-05-17 20:17 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <298f5c050905150745p13dc226eia1ff50ffa8c4b300@mail.gmail.com>
2009-05-15 14:49 ` HTB accuracy for high speed Antonio Almeida
2009-05-15 18:12   ` Stephen Hemminger
2009-05-18 10:01     ` Antonio Almeida
2009-05-18 10:45       ` Jarek Poplawski
2009-05-18 12:27         ` Antonio Almeida
2009-05-18 12:32           ` Jarek Poplawski
2009-05-18 16:13       ` Stephen Hemminger
2009-05-18 18:03         ` Antonio Almeida
2009-05-18 22:02         ` Stephen Hemminger
2009-05-19 11:48           ` Antonio Almeida
2009-05-19 13:08             ` Antonio Almeida
2009-05-16  8:31   ` Jarek Poplawski
2009-05-18 10:39     ` Antonio Almeida
2009-05-18 11:14       ` Jarek Poplawski
2009-05-18 12:05         ` Antonio Almeida
2009-05-16 14:14   ` Jarek Poplawski
2009-05-18 14:36     ` Antonio Almeida
2009-05-18 23:14       ` Vladimir Ivashchenko
2009-05-18 23:27         ` Vladimir Ivashchenko
2009-05-19 11:03           ` Jarek Poplawski
2009-05-19 14:04             ` Vladimir Ivashchenko
2009-05-19 20:10               ` Jarek Poplawski
2009-05-20 22:07                 ` Vladimir Ivashchenko
2009-05-20 22:46                   ` Eric Dumazet
2009-05-21  7:20                     ` Jarek Poplawski
2009-05-21  7:44                       ` Vladimir Ivashchenko
2009-05-21  8:28                         ` Jarek Poplawski
2009-05-21  9:07                           ` Eric Dumazet
2009-05-21  9:22                             ` Jarek Poplawski
2009-05-23 10:37                           ` HTB accuracy for high speed (and bonding) Vladimir Ivashchenko
2009-05-23 14:34                             ` Jarek Poplawski
2009-05-23 15:06                               ` Vladimir Ivashchenko
2009-05-23 15:35                                 ` Jarek Poplawski
2009-05-23 15:53                                   ` Vladimir Ivashchenko
2009-05-23 16:02                                     ` Jarek Poplawski
2009-05-18 16:40     ` HTB accuracy for high speed Eric Dumazet
2009-05-18 17:23       ` Jarek Poplawski
2009-05-18 21:52         ` David Miller
2009-05-18 23:59           ` [PATCH] pkt_sched: gen_estimator: use 64 bits intermediate counters for bps Eric Dumazet
2009-05-19  2:27             ` David Miller
2009-05-19  7:02             ` Jarek Poplawski
2009-05-19  7:31               ` Eric Dumazet
2009-05-19  7:42                 ` Jarek Poplawski
2009-05-19  7:57                   ` Jarek Poplawski
2009-05-19 18:03                     ` Eric Dumazet
2009-05-19 19:09                       ` [PATCH] pkt_sched: gen_estimator: Fix signed integers right-shifts Jarek Poplawski
2009-05-26  5:47                         ` David Miller
2009-05-19  8:18                 ` [PATCH] pkt_sched: gen_estimator: use 64 bits intermediate counters for bps David Miller
2009-05-17 20:15   ` Jarek Poplawski [this message]
2009-05-18  6:56     ` [PATCH iproute2] Re: HTB accuracy for high speed Jarek Poplawski
2009-05-18 16:54       ` Antonio Almeida
2009-05-18 17:16         ` Antonio Almeida
2009-05-21  8:51           ` Jarek Poplawski
2009-05-22 17:42             ` Antonio Almeida
2009-05-23  7:32               ` Jarek Poplawski
2009-05-28 18:13                 ` Antonio Almeida
2009-05-28 21:12                   ` Jarek Poplawski
2009-05-29 17:02                     ` Antonio Almeida
2009-05-29 17:28                       ` Stephen Hemminger
2009-05-29 19:58                         ` Jarek Poplawski
2009-05-29 19:46                       ` Jarek Poplawski
2009-05-29 20:49                         ` Stephen Hemminger
2009-05-29 20:59                           ` Jarek Poplawski
2009-05-30 20:07                       ` Jarek Poplawski
2009-06-02 10:12                         ` Antonio Almeida
2009-06-02 11:45                           ` Antonio Almeida
2009-06-02 12:36                             ` Jarek Poplawski
2009-06-02 12:45                               ` Patrick McHardy
2009-06-02 13:08                                 ` Jarek Poplawski
2009-06-02 13:20                                   ` Patrick McHardy
2009-06-02 21:37                                     ` Jarek Poplawski
2009-06-02 21:50                                       ` Jarek Poplawski
2009-06-03  7:06                                         ` Patrick McHardy
2009-06-03  7:40                                           ` Jarek Poplawski
2009-06-03  7:53                                             ` Patrick McHardy
2009-06-03  8:01                                               ` Jarek Poplawski
2009-06-03  8:29                                                 ` Patrick McHardy
2009-06-03  8:45                                                   ` Jarek Poplawski
2009-06-03  9:54                                               ` Jarek Poplawski
2009-06-03 10:01                                                 ` Patrick McHardy
2009-06-03 10:05                                                   ` Patrick McHardy
2009-06-03 10:06                                                     ` Patrick McHardy
2009-06-03 10:27                                                       ` Jarek Poplawski
2009-06-04 13:50                                                 ` Antonio Almeida
     [not found]                                                   ` <20090604193013.GA2755@ami.dom.local>
     [not found]                                                     ` <4A282216.20203@trash.net>
     [not found]                                                       ` <20090604194203.GB2755@ami.dom.local>
2009-06-09  5:25                                                         ` Badalian Vyacheslav
2009-06-09  5:49                                                           ` Jarek Poplawski
2009-06-04  4:53                                               ` David Miller
2009-06-04  7:50                                                 ` Jarek Poplawski
2009-05-18 17:53         ` Jarek Poplawski
2009-05-18 18:23           ` Antonio Almeida
2009-05-18 18:32             ` Jarek Poplawski
2009-05-18 18:56               ` Antonio Almeida
2009-05-18 19:05                 ` Jarek Poplawski
2009-05-19 10:55                   ` Antonio Almeida
2009-05-19 11:04                     ` Denys Fedoryschenko
2009-05-19 11:18                       ` Jarek Poplawski
2009-05-19 11:21                         ` Denys Fedoryschenko
2009-05-19 11:28                           ` Jarek Poplawski
2009-05-19 14:31                             ` Antonio Almeida
2009-05-19 11:09                     ` Jarek Poplawski
2009-05-19 13:18                   ` Jesper Dangaard Brouer
2009-05-19 19:35                     ` Jarek Poplawski
2009-05-18  7:01     ` [PATCH iproute2 v2] " Jarek Poplawski
2009-05-17 20:29   ` Vladimir Ivashchenko

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=20090517201528.GA8552@ami.dom.local \
    --to=jarkao2@gmail.com \
    --cc=davem@davemloft.net \
    --cc=devik@cdi.cz \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=vexwek@gmail.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;
as well as URLs for NNTP newsgroup(s).