Hello! I run my script, then check the results. Pieces of output: <result> root@arthur:/etc/init.d# tc -s -d class show dev imq0 class htb 1:1010 parent 1:1 rate 7Kbit ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b overhead 0b level 6 Sent 13646 bytes 42 pkts (dropped 0, overlimits 0) rate 106bps lended: 0 borrowed: 22 giants: 0 tokens: -155926 ctokens: -95231 class htb 1:1023 parent 1:1020 leaf 1023: prio 3 quantum 1000 rate 2Kbit ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b overhead 0b level 0 Sent 315580 bytes 964 pkts (dropped 0, overlimits 0) rate 5485bps 16pps backlog 44p lended: 60 borrowed: 860 giants: 0 tokens: -3424256 ctokens: -62464 class htb 1:1032 parent 1:1030 leaf 1032: prio 2 quantum 1000 rate 3Kbit ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 2133332 ctokens: 128000 class htb 1:1045 parent 1:1040 leaf 1045: prio 5 quantum 1000 rate 1Kbit ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 6400000 ctokens: 128000 class htb 1:1054 parent 1:1050 leaf 1054: prio 4 quantum 1000 rate 1Kbit ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b overhead 0b level 0 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 6400000 ctokens: 128000 class htb 1:1 root rate 50Kbit ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b overhead 0b level 7 Sent 322094 bytes 1014 pkts (dropped 0, overlimits 0) rate 5593bps 16pps lended: 803 borrowed: 0 giants: 0 tokens: -186353 ctokens: -186353 </result> 1. Why do I have negative number of tokens in some classes, especially 1:1 ? I don''t think it should be possible. 2. Probably connected to question 1, having rate=ceil=50kbit why can I still download stuff at rate ~10Kbyte/s? 3. Same parameters as above, downloads go at rate ~10Kbyte/s: root@arthur:/etc/init.d# tc -s -d qdisc show dev imq0 qdisc htb 1: r2q 1 default 1015 direct_packets_stat 9 ver 3.13 Sent 1698356 bytes 4852 pkts (dropped 40, overlimits 7224) backlog 61p In general something is very wrong here. I''m unable to limit traffic to become bottleneck and be able to shape traffic. Can anyone tell me why? (If output isn''t enough I can send my script which is quite big, ~14Kbytes) Greetings -- --== Jacek "Dino" Bilski ==-- --== Registered Linux User #165468 ==-- --== dino@camelot.homedns.org ==-- --== GG# 3484913 ==-- -= 1024D/5B44CFBE 2228 3F73 A678 81C3 4ABE 2617 C77C AE70 5B44 CFBE =- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Sunday 16 November 2003 01:49, Jacek Bilski wrote:> Hello! > > I run my script, then check the results. Pieces of output: > > <result> > > root@arthur:/etc/init.d# tc -s -d class show dev imq0 > class htb 1:1010 parent 1:1 rate 7Kbit ceil 50Kbit burst 999b/8 mpu 0b > overhead 0b cburst 999b/8 mpu 0b overhead 0b level 6 > Sent 13646 bytes 42 pkts (dropped 0, overlimits 0) > rate 106bps > lended: 0 borrowed: 22 giants: 0 > tokens: -155926 ctokens: -95231 > > class htb 1:1023 parent 1:1020 leaf 1023: prio 3 quantum 1000 rate 2Kbit > ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b > overhead 0b level > 0 > Sent 315580 bytes 964 pkts (dropped 0, overlimits 0) > rate 5485bps 16pps backlog 44p > lended: 60 borrowed: 860 giants: 0 > tokens: -3424256 ctokens: -62464 > > class htb 1:1032 parent 1:1030 leaf 1032: prio 2 quantum 1000 rate 3Kbit > ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b > overhead 0b level > 0 > Sent 0 bytes 0 pkts (dropped 0, overlimits 0) > lended: 0 borrowed: 0 giants: 0 > tokens: 2133332 ctokens: 128000 > > class htb 1:1045 parent 1:1040 leaf 1045: prio 5 quantum 1000 rate 1Kbit > ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b > overhead 0b level > 0 > Sent 0 bytes 0 pkts (dropped 0, overlimits 0) > lended: 0 borrowed: 0 giants: 0 > tokens: 6400000 ctokens: 128000 > > class htb 1:1054 parent 1:1050 leaf 1054: prio 4 quantum 1000 rate 1Kbit > ceil 50Kbit burst 999b/8 mpu 0b overhead 0b cburst 999b/8 mpu 0b > overhead 0b level > 0 > Sent 0 bytes 0 pkts (dropped 0, overlimits 0) > lended: 0 borrowed: 0 giants: 0 > tokens: 6400000 ctokens: 128000 > > class htb 1:1 root rate 50Kbit ceil 50Kbit burst 999b/8 mpu 0b overhead > 0b cburst 999b/8 mpu 0b overhead 0b level 7 > Sent 322094 bytes 1014 pkts (dropped 0, overlimits 0) > rate 5593bps 16pps > lended: 803 borrowed: 0 giants: 0 > tokens: -186353 ctokens: -186353 > > </result> > > 1. Why do I have negative number of tokens in some classes, especially > 1:1 ? I don''t think it should be possible.Why not? Class 1:1 has child classes. These child classes are able to send pckets as long as they have tokens. Even if the parent has no tokens left, they still can send packets as long as they have tokens. So they can drag the parent tokens negative. But I don''t understand why class 1:1023 has negative tokens? Is this is a leaf class ?> 2. Probably connected to question 1, having rate=ceil=50kbit why can I > still download stuff at rate ~10Kbyte/s?Normally you shouldn''t.> (If output isn''t enough I can send my script which is quite big, > ~14Kbytes)Can you send us only the tc class/qdisc commands ? Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Hello! On nie, 2003-11-16 at 12:09, Stef Coene wrote: <cut/>> > 1. Why do I have negative number of tokens in some classes, especially > > 1:1 ? I don''t think it should be possible. > Why not? Class 1:1 has child classes. These child classes are able to send > pckets as long as they have tokens. Even if the parent has no tokens left, > they still can send packets as long as they have tokens. So they can drag > the parent tokens negative. > But I don''t understand why class 1:1023 has negative tokens? Is this is a > leaf class ?Yes, it''s leaf class. I recomiled my kernel and they are again negative. Maybe it''s something about my kernel? I did some patching: kernel 2.4.22 + grsecurity 1.9.12 + patch-o-matic 20030912 (quite lot''s of patches) with htb20030625 patch + imq for 2.4.21 + imqnat + layer7 0.4.1a iproute2 with layer7 + htb overhead patch iptables 1.2.9 + grsecurity 1.2.9 + layer 0.2 + patch-o-matic 20030912 with htb20030625 patch> > (If output isn''t enough I can send my script which is quite big, > > ~14Kbytes) > Can you send us only the tc class/qdisc commands ?Sure: <script> tc qdisc del dev imq0 root modprobe imq ip link set imq0 up tc qdisc add dev imq0 root handle 1 htb default 1015 r2q 1 tc class add dev imq0 parent 1:0 classid 1:1 htb rate 50kbit ceil 50kbit tc class add dev imq0 parent 1:1 classid 1:1010 htb rate 7kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1 classid 1:1020 htb rate 7kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1 classid 1:1030 htb rate 7kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1 classid 1:1040 htb rate 7kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1 classid 1:1050 htb rate 7kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1 classid 1:1060 htb rate 7kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1 classid 1:1070 htb rate 7kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1010 classid 1:1011 htb rate 3kbit ceil 50kbit prio 1 tc class add dev imq0 parent 1:1010 classid 1:1012 htb rate 3kbit ceil 50kbit prio 2 tc class add dev imq0 parent 1:1010 classid 1:1013 htb rate 2kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1010 classid 1:1014 htb rate 1kbit ceil 50kbit prio 4 tc class add dev imq0 parent 1:1010 classid 1:1015 htb rate 1kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1020 classid 1:1021 htb rate 3kbit ceil 50kbit prio 1 tc class add dev imq0 parent 1:1020 classid 1:1022 htb rate 3kbit ceil 50kbit prio 2 tc class add dev imq0 parent 1:1020 classid 1:1023 htb rate 2kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1020 classid 1:1024 htb rate 1kbit ceil 50kbit prio 4 tc class add dev imq0 parent 1:1020 classid 1:1025 htb rate 1kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1030 classid 1:1031 htb rate 3kbit ceil 50kbit prio 1 tc class add dev imq0 parent 1:1030 classid 1:1032 htb rate 3kbit ceil 50kbit prio 2 tc class add dev imq0 parent 1:1030 classid 1:1033 htb rate 2kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1030 classid 1:1034 htb rate 1kbit ceil 50kbit prio 4 tc class add dev imq0 parent 1:1030 classid 1:1035 htb rate 1kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1040 classid 1:1041 htb rate 3kbit ceil 50kbit prio 1 tc class add dev imq0 parent 1:1040 classid 1:1042 htb rate 3kbit ceil 50kbit prio 2 tc class add dev imq0 parent 1:1040 classid 1:1043 htb rate 2kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1040 classid 1:1044 htb rate 1kbit ceil 50kbit prio 4 tc class add dev imq0 parent 1:1040 classid 1:1045 htb rate 1kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1050 classid 1:1051 htb rate 3kbit ceil 50kbit prio 1 tc class add dev imq0 parent 1:1050 classid 1:1052 htb rate 3kbit ceil 50kbit prio 2 tc class add dev imq0 parent 1:1050 classid 1:1053 htb rate 2kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1050 classid 1:1054 htb rate 1kbit ceil 50kbit prio 4 tc class add dev imq0 parent 1:1050 classid 1:1055 htb rate 1kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1060 classid 1:1061 htb rate 3kbit ceil 50kbit prio 1 tc class add dev imq0 parent 1:1060 classid 1:1062 htb rate 3kbit ceil 50kbit prio 2 tc class add dev imq0 parent 1:1060 classid 1:1063 htb rate 2kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1060 classid 1:1064 htb rate 1kbit ceil 50kbit prio 4 tc class add dev imq0 parent 1:1060 classid 1:1065 htb rate 1kbit ceil 50kbit prio 5 tc class add dev imq0 parent 1:1070 classid 1:1071 htb rate 3kbit ceil 50kbit prio 1 tc class add dev imq0 parent 1:1070 classid 1:1072 htb rate 3kbit ceil 50kbit prio 2 tc class add dev imq0 parent 1:1070 classid 1:1073 htb rate 2kbit ceil 50kbit prio 3 tc class add dev imq0 parent 1:1070 classid 1:1074 htb rate 1kbit ceil 50kbit prio 4 tc class add dev imq0 parent 1:1070 classid 1:1075 htb rate 1kbit ceil 50kbit prio 5 tc qdisc add dev imq0 parent 1:1011 handle 1011 sfq perturb 10 tc qdisc add dev imq0 parent 1:1012 handle 1012 sfq perturb 10 tc qdisc add dev imq0 parent 1:1013 handle 1013 sfq perturb 10 tc qdisc add dev imq0 parent 1:1014 handle 1014 sfq perturb 10 tc qdisc add dev imq0 parent 1:1015 handle 1015 sfq perturb 10 tc qdisc add dev imq0 parent 1:1021 handle 1021 sfq perturb 10 tc qdisc add dev imq0 parent 1:1022 handle 1022 sfq perturb 10 tc qdisc add dev imq0 parent 1:1023 handle 1023 sfq perturb 10 tc qdisc add dev imq0 parent 1:1024 handle 1024 sfq perturb 10 tc qdisc add dev imq0 parent 1:1025 handle 1025 sfq perturb 10 tc qdisc add dev imq0 parent 1:1031 handle 1031 sfq perturb 10 tc qdisc add dev imq0 parent 1:1032 handle 1032 sfq perturb 10 tc qdisc add dev imq0 parent 1:1033 handle 1033 sfq perturb 10 tc qdisc add dev imq0 parent 1:1034 handle 1034 sfq perturb 10 tc qdisc add dev imq0 parent 1:1035 handle 1035 sfq perturb 10 tc qdisc add dev imq0 parent 1:1041 handle 1041 sfq perturb 10 tc qdisc add dev imq0 parent 1:1042 handle 1042 sfq perturb 10 tc qdisc add dev imq0 parent 1:1043 handle 1043 sfq perturb 10 tc qdisc add dev imq0 parent 1:1044 handle 1044 sfq perturb 10 tc qdisc add dev imq0 parent 1:1045 handle 1045 sfq perturb 10 tc qdisc add dev imq0 parent 1:1051 handle 1051 sfq perturb 10 tc qdisc add dev imq0 parent 1:1052 handle 1052 sfq perturb 10 tc qdisc add dev imq0 parent 1:1053 handle 1053 sfq perturb 10 tc qdisc add dev imq0 parent 1:1054 handle 1054 sfq perturb 10 tc qdisc add dev imq0 parent 1:1055 handle 1055 sfq perturb 10 tc qdisc add dev imq0 parent 1:1061 handle 1061 sfq perturb 10 tc qdisc add dev imq0 parent 1:1062 handle 1062 sfq perturb 10 tc qdisc add dev imq0 parent 1:1063 handle 1063 sfq perturb 10 tc qdisc add dev imq0 parent 1:1064 handle 1064 sfq perturb 10 tc qdisc add dev imq0 parent 1:1065 handle 1065 sfq perturb 10 tc qdisc add dev imq0 parent 1:1071 handle 1071 sfq perturb 10 tc qdisc add dev imq0 parent 1:1072 handle 1072 sfq perturb 10 tc qdisc add dev imq0 parent 1:1073 handle 1073 sfq perturb 10 tc qdisc add dev imq0 parent 1:1074 handle 1074 sfq perturb 10 tc qdisc add dev imq0 parent 1:1075 handle 1075 sfq perturb 10 </script> Greetings -- --== Jacek "Dino" Bilski ==-- --== Registered Linux User #165468 ==-- --== dino@camelot.homedns.org ==-- --== GG# 3484913 ==-- -= 1024D/5B44CFBE 2228 3F73 A678 81C3 4ABE 2617 C77C AE70 5B44 CFBE =- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Sunday 16 November 2003 12:33, Jacek Bilski wrote:> > Why not? Class 1:1 has child classes. These child classes are able to > > send pckets as long as they have tokens. Even if the parent has no > > tokens left, they still can send packets as long as they have tokens. So > > they can drag the parent tokens negative. > > But I don''t understand why class 1:1023 has negative tokens? Is this is > > a leaf class ? > > Yes, it''s leaf class. I recomiled my kernel and they are again negative. > > Maybe it''s something about my kernel? I did some patching: > > kernel 2.4.22 + grsecurity 1.9.12 + patch-o-matic 20030912 (quite lot''s > of patches) with htb20030625 patch + imq for 2.4.21 + imqnat + layer7 > 0.4.1a > > iproute2 with layer7 + htb overhead patch > > iptables 1.2.9 + grsecurity 1.2.9 + layer 0.2 + patch-o-matic 20030912 > with htb20030625 patchKernel is not important. But I just realised that the tokens can be negative. And it''s not because a problem that the tokens are negative.> > > (If output isn''t enough I can send my script which is quite big, > > > ~14Kbytes) > > > > Can you send us only the tc class/qdisc commands ? > > Sure: > > <script> > tc qdisc del dev imq0 root > modprobe imq > ip link set imq0 up > tc qdisc add dev imq0 root handle 1 htb default 1015 r2q 1 > tc class add dev imq0 parent 1:0 classid 1:1 htb rate 50kbit ceil 50kbit > tc class add dev imq0 parent 1:1 classid 1:1010 htb rate 7kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1 classid 1:1020 htb rate 7kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1 classid 1:1030 htb rate 7kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1 classid 1:1040 htb rate 7kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1 classid 1:1050 htb rate 7kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1 classid 1:1060 htb rate 7kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1 classid 1:1070 htb rate 7kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1010 classid 1:1011 htb rate 3kbit ceil > 50kbit prio 1 > tc class add dev imq0 parent 1:1010 classid 1:1012 htb rate 3kbit ceil > 50kbit prio 2 > tc class add dev imq0 parent 1:1010 classid 1:1013 htb rate 2kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1010 classid 1:1014 htb rate 1kbit ceil > 50kbit prio 4 > tc class add dev imq0 parent 1:1010 classid 1:1015 htb rate 1kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1020 classid 1:1021 htb rate 3kbit ceil > 50kbit prio 1 > tc class add dev imq0 parent 1:1020 classid 1:1022 htb rate 3kbit ceil > 50kbit prio 2 > tc class add dev imq0 parent 1:1020 classid 1:1023 htb rate 2kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1020 classid 1:1024 htb rate 1kbit ceil > 50kbit prio 4 > tc class add dev imq0 parent 1:1020 classid 1:1025 htb rate 1kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1030 classid 1:1031 htb rate 3kbit ceil > 50kbit prio 1 > tc class add dev imq0 parent 1:1030 classid 1:1032 htb rate 3kbit ceil > 50kbit prio 2 > tc class add dev imq0 parent 1:1030 classid 1:1033 htb rate 2kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1030 classid 1:1034 htb rate 1kbit ceil > 50kbit prio 4 > tc class add dev imq0 parent 1:1030 classid 1:1035 htb rate 1kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1040 classid 1:1041 htb rate 3kbit ceil > 50kbit prio 1 > tc class add dev imq0 parent 1:1040 classid 1:1042 htb rate 3kbit ceil > 50kbit prio 2 > tc class add dev imq0 parent 1:1040 classid 1:1043 htb rate 2kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1040 classid 1:1044 htb rate 1kbit ceil > 50kbit prio 4 > tc class add dev imq0 parent 1:1040 classid 1:1045 htb rate 1kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1050 classid 1:1051 htb rate 3kbit ceil > 50kbit prio 1 > tc class add dev imq0 parent 1:1050 classid 1:1052 htb rate 3kbit ceil > 50kbit prio 2 > tc class add dev imq0 parent 1:1050 classid 1:1053 htb rate 2kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1050 classid 1:1054 htb rate 1kbit ceil > 50kbit prio 4 > tc class add dev imq0 parent 1:1050 classid 1:1055 htb rate 1kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1060 classid 1:1061 htb rate 3kbit ceil > 50kbit prio 1 > tc class add dev imq0 parent 1:1060 classid 1:1062 htb rate 3kbit ceil > 50kbit prio 2 > tc class add dev imq0 parent 1:1060 classid 1:1063 htb rate 2kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1060 classid 1:1064 htb rate 1kbit ceil > 50kbit prio 4 > tc class add dev imq0 parent 1:1060 classid 1:1065 htb rate 1kbit ceil > 50kbit prio 5 > tc class add dev imq0 parent 1:1070 classid 1:1071 htb rate 3kbit ceil > 50kbit prio 1 > tc class add dev imq0 parent 1:1070 classid 1:1072 htb rate 3kbit ceil > 50kbit prio 2 > tc class add dev imq0 parent 1:1070 classid 1:1073 htb rate 2kbit ceil > 50kbit prio 3 > tc class add dev imq0 parent 1:1070 classid 1:1074 htb rate 1kbit ceil > 50kbit prio 4 > tc class add dev imq0 parent 1:1070 classid 1:1075 htb rate 1kbit ceil > 50kbit prio 5Your commands are looking fine. However, the rate parameters are too small. You probably get some htb errors in your kernel log about quantum. Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/