RE: 2.6.14 - HTB/SFQ QoS broken?

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Klauer wrote:
> On Tuesday 27 December 2005 21:51, Leo Bogert wrote:
>> $addclass 1:0 classid $cMAIN htb rate $IFUP mtu 1492
>> 
>> classid $cEMULE    htb rate 8kbps  ceil $IFUP prio 4
>> classid $cAPACHE   htb rate 32kbps ceil $IFUP prio 2
>> classid $cDEFAULT  htb rate $IFUP  burst 6k prio 1
> 
> So, the parent class offers $IFUP rate, but the children are
> trying to
> use 8kbps+32kbps+$IFUP. It's hard to tell what HTB will do in
> this case.
>> As you can see, eMule can use all bandwidth as long as nobody is
>> requesting something from the webserver. If somebody is downloading
>> from the server, he should receive 32kbps and eMule should be slowed
>> down. 
> 
> Yes, apache should be able to receive 32kbps, emule 8kbps,
> and everything
> else the full bandwidth, all together at all times. But since
> there is not
> that much bandwidth available (it's just $IFUP in total after all),
> something has to give way. 

When configuring this, I thought the priorities would make that work.
They even DID that because it was working once.
The whole point why I configured it like that:
I (and everyone else probably) want the scheduler to be like:
"Give all bandwidth to eMule if nothing else is running.
If miranda filetransfer is running give all bandwidth to it
UNLESS Apache is running, then Apache should receive all bandwidth."
This is not possible if the bandwidth reservations dont overlap, is it?
Or can anyone tell me a different qdisc / solution which allows this?

>> BUT now I have checked the speed of my webserver, and when eMule is
>> running it is only at 4 kb/s instead of 32 kb/s.
>> 
>> AND I have found the reason for this: If I remove the SFQs,
>> scheduling seems to work - at least at the "bad precision" of HTB:
>> Apache receives over 20 kb/s and eMule is limited to 12 kb/s instead
>> of 8. 
> 
> The way I understand HTB, your class structure is simply
> overallocated, and the results you get from that are random at best.
> Before continuing, you should make sure that the sum of children
> class rates is equal to the parent class rate. 

I did that for testing purposes, and it still does not work.
Results follow below...

> Could you post your reconfigured setup, possibly with proper
> class names and rates instead of variables that could be anything?

In this case, Miranda (instant messenger equal to ICQ) filetransfer is
used for testing instead of Apache. The following script works, the
assignment of the packages to the classes by the firewall also works
(has been working for years :), output of tc show follows also.

--------------------------------
IF=dev ppp0
IFUP=48kbps
cMAIN=1:1
cEMULE=1:11
cMIRANDA=1:13
cDEFAULT=1:20
q1="quantum 1492"
q2="quantum 2984"
addc="tc class add $IF parent"
addq="tc qdisc add $IF parent"

tc qdisc add $IF root handle 1:0 htb default 20 r2q 4
$addc 1:0 classid $cMAIN htb rate $IFUP mtu 1492

$addc $cMAIN classid $cEMULE    htb rate 8kbps  ceil $IFUP $q1 prio 5
$addc $cMAIN classid $cMIRANDA  htb rate 30kbps ceil $IFUP $q2 prio 2
$addc $cMAIN classid $cDEFAULT  htb rate 10kbps ceil $IFUP burst 6k $q2 prio
1

$addq $cEMULE   handle 10: sfq perturb 10
$addq $cMIRANDA handle 30: sfq perturb 10
$addq $cDEFAULT handle 90: sfq perturb 10
--------------------------------
Only eMule running, without upload limit:

(eMule)
class htb 1:11 parent 1:1 leaf 10: prio 5 rate 64000bit ceil 384000bit burst
1631b cburst 1791b
 Sent 4317513 bytes 4779 pkts (dropped 0, overlimits 0)
 rate 357184bit 50pps backlog 6p
 lended: 864 borrowed: 3909 giants: 0
 tokens: -233470 ctokens: -59031

class htb 1:1 root rate 384000bit ceil 384000bit burst 1683b cburst 1683b
 Sent 4322505 bytes 4955 pkts (dropped 0, overlimits 0)
 rate 358768bit 51pps
 lended: 3909 borrowed: 0 giants: 0
 tokens: -61335 ctokens: -61335

(Miranda)
class htb 1:13 parent 1:1 leaf 30: prio 2 rate 240000bit ceil 384000bit
burst 1719b cburst 1791b
 Sent 178 bytes 4 pkts (dropped 0, overlimits 0)
 rate 16bit
 lended: 4 borrowed: 0 giants: 0
 tokens: 57344 ctokens: 37376

(default)
class htb 1:20 parent 1:1 leaf 90: prio 1 rate 80000bit ceil 384000bit burst
6Kb cburst 1791b
 Sent 11666 bytes 178 pkts (dropped 0, overlimits 0)
 rate 976bit 1pps
 lended: 178 borrowed: 0 giants: 0
 tokens: 625051 ctokens: 37376
--------------------------------
Miranda filetransfer started then and running for some time:

(eMule)
class htb 1:11 parent 1:1 leaf 10: prio 5 rate 64000bit ceil 384000bit burst
1631b cburst 1791b
 Sent 8932587 bytes 10702 pkts (dropped 0, overlimits 0)
 rate 221400bit 37pps backlog 9p
 lended: 2413 borrowed: 8280 giants: 0
 tokens: -176116 ctokens: -27978

class htb 1:1 root rate 384000bit ceil 384000bit burst 1683b cburst 1683b
 Sent 11132785 bytes 13156 pkts (dropped 0, overlimits 0)
 rate 381240bit 57pps
 lended: 8336 borrowed: 0 giants: 0
 tokens: -106565 ctokens: -106565

(Miranda)
class htb 1:13 parent 1:1 leaf 30: prio 2 rate 240000bit ceil 384000bit
burst 1719b cburst 1791b
 Sent 2181127 bytes 2032 pkts (dropped 0, overlimits 0)
 rate 155336bit 17pps
 lended: 1976 borrowed: 56 giants: 0
 tokens: -40140 ctokens: -23550

class htb 1:20 parent 1:1 leaf 90: prio 1 rate 80000bit ceil 384000bit burst
6Kb cburst 1791b
 Sent 27726 bytes 431 pkts (dropped 0, overlimits 0)
 rate 952bit 1pps
 lended: 431 borrowed: 0 giants: 0
 tokens: 617677 ctokens: 35840


_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux