Hi Andy, Am Montag, 8. Juli 2013, 22:27:03 schrieb Andrew Beverley: > On Sat, 2013-07-06 at 18:23 +0200, maillinglistredcap@xxxxxx wrote: > > Hi there, > > > > I'm new to this list and new to traffic control as well. I want to do some > > traffic shaping on my home network and over the past few days I've > > studied the subject quite a lot. Today I decided to some first > > experiments on my network using the HTB queueing discpline which seems to > > suit my purposes best. Well the first results were disappointing... most > > likely due to my lack of knowledge. > You're not sending any traffic into your single leaf class. Yes, I'm aware of that. I posted only a part of my configurations to illustrate the fact, that cburst settings are ignored. But maybe it's more useful if I give the whole configuration. My qdisc tree is as follows: tc qdisc del dev eth0 root 2>/dev/null tc qdisc add dev eth0 root handle 1: htb default 110 tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit cburst 1602b tc class add dev eth0 parent 1:1 classid 1:10 htb rate 99780kbit tc class add dev eth0 parent 1:1 classid 1:11 htb rate 220kbit tc class add dev eth0 parent 1:11 classid 1:110 htb rate 180kbit ceil 220kbit tc class add dev eth0 parent 1:11 classid 1:111 htb rate 40kbit ceil 220kbit This tree is on a machine in my network that has only one NIC. There is also a router on my network with a 224 kbit uplink internet connection. I run some services on the machine (e.g. bittorrent) that tend to clog up my internet connection. My approach is to direct all local traffic to the class with minor ID 10. Other traffic should be handled by class 1:11. In this class I have two subclasses. One for services were responsiveness is crucial ( classid 1:110) and a class (classid 1:111) that should handle other traffic (e.g. bittorrent). Here is my iptables configuration: iptables -t mangle -N lantraffic iptables -t mangle -A lantraffic -j CLASSIFY --set-class 1:10 iptables -t mangle -A lantraffic -j ACCEPT iptables -t mangle -N wantraffic iptables -t mangle -A wantraffic -o eth0 -p tcp -m length --length :64 -j CLASSIFY --set-class 1:110 iptables -t mangle -A wantraffic -o eth0 -m owner --uid-owner torrent -j CLASSIFY --set-class 1:111 iptables -t mangle -A wantraffic -j ACCEPT iptables -t mangle -A POSTROUTING -o eth0 -d 192.168.2.0/24 -j lantraffic iptables -t mangle -A POSTROUTING -o eth0 ! -d 192.168.2.0/24 -j wantraffic However, these settings don't work as I intended. Most of the time loading websites is very slow ( I also have privoxy running on the machine, so the above qdiscs should apply to HTTP/S traffic on my network). Here are my statistics after about 5 minutes of websurfing with the qdisc active: parzival traffic # tc -s class show dev eth0 class htb 1:11 parent 1:1 rate 220000bit ceil 220000bit burst 1599b cburst 1599b Sent 7098894 bytes 20291 pkt (dropped 0, overlimits 0 requeues 0) rate 151240bit 29pps backlog 0b 0p requeues 0 lended: 3784 borrowed: 0 giants: 0 tokens: -42215522 ctokens: -42215522 class htb 1:110 parent 1:11 prio 0 rate 180000bit ceil 220000bit burst 1599b cburst 1955b Sent 1383696 bytes 14676 pkt (dropped 0, overlimits 0 requeues 0) rate 8616bit 11pps backlog 0b 0p requeues 0 lended: 14628 borrowed: 48 giants: 0 tokens: 68710977 ctokens: 69147340 class htb 1:111 parent 1:11 prio 0 rate 40000bit ceil 220000bit burst 1600b cburst 8800b Sent 5715198 bytes 5615 pkt (dropped 0, overlimits 0 requeues 0) rate 142624bit 17pps backlog 0b 14p requeues 0 lended: 1879 borrowed: 3736 giants: 0 tokens: -129515223 ctokens: 219603486 class htb 1:1 root rate 100000Kbit ceil 100000Kbit burst 1600b cburst 1600b Sent 27883416 bytes 37148 pkt (dropped 0, overlimits 0 requeues 0) rate 389912bit 52pps backlog 0b 0p requeues 0 lended: 0 borrowed: 0 giants: 0 tokens: 118880 ctokens: 118880 class htb 1:10 parent 1:1 prio 0 rate 99780Kbit ceil 99780Kbit burst 1596b cburst 1596b Sent 20784522 bytes 16857 pkt (dropped 0, overlimits 0 requeues 0) rate 238680bit 24pps backlog 0b 0p requeues 0 lended: 16857 borrowed: 0 giants: 0 tokens: 118860 ctokens: 118860 As stated above, websurfing was not very responsive most of the time. I don't know the exact implications of the burst and cburst parameters but I noticed that the cburst in class 1:111 is quite large (8800b). The rule of thumb for cburst seems to be to choose it as close to MTU as possible (1500 in my case). As far as I understand, a high cburst setting implies that the class can break its ceil rate on the expense of its siblings and the higher the cburst the longer the time the class can operate above its ceil rate. I was wondering if this is the reason for the poor performance. Unfortunately, cburst settings specified by me are simply ignored by tc and so I have no idea how to investigate further :-(. Cheers redcap -- To unsubscribe from this list: send the line "unsubscribe lartc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html