2

I'm using iptables + htb to shape the bandwidth of the internet traffic. I have a link of 17mbit DSL. Actually I have set the rules bellow:

# Interface eth0 (Donwload)
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 htb default 10
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 17mbit
tc class add dev eth0 parent 1:0 classid 1:10 htb rate 8mbit ceil 17mbit # Default Class
tc class add dev eth0 parent 1:0 classid 1:20 htb rate 1mbit ceil 17mbit # RDP Class
tc class add dev eth0 parent 1:0 classid 1:30 htb rate 7mbit ceil 17mbit # HTTP/HTTPS Class
tc class add dev eth0 parent 1:0 classid 1:40 htb rate 1mbit ceil 17mbit # DNS Class

The HTTP/HTTPS class is just to our external dedicated servers. These servers has a high traffic of HTTP/HTTPS then I guarantee a minimum rate of 7mbit with ceil of 17mbit. But the problem is when the other classes aren't using their bandwidth fully, the HTTP/HTTPS class doesn't increases his rate to reach 17mbit. It happended with all classes. See the result of the command "tc -s -d class show dev eth0"

See that any classes doesn't "borrow" available bandwidth from other classes even having.

class htb 1:1 root prio 0 quantum 200000 rate 17000Kbit ceil 17000Kbit   linklayer ethernet burst 1598b/1 mpu 0b overhead 0b cburst 1598b/1 mpu 0b overhead 0b level 0 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 0b 0p requeues 0 
 lended: 0 borrowed: 0 giants: 0
 tokens: 11750 ctokens: 11750

class htb 1:10 root prio 0 quantum 100000 rate 8000Kbit ceil 17000Kbit linklayer ethernet burst 1600b/1 mpu 0b overhead 0b cburst 1598b/1 mpu 0b overhead 0b level 0 
 Sent 3188470523 bytes 3905364 pkt (dropped 2262, overlimits 0 requeues 0) 
 rate 0bit 0pps backlog 0b 0p requeues 0 
 lended: 3883404 borrowed: 0 giants: 0
 tokens: 23406 ctokens: 11000

class htb 1:20 root prio 0 quantum 12500 rate 1000Kbit ceil 17000Kbit linklayer ethernet burst 1600b/1 mpu 0b overhead 0b cburst 1598b/1 mpu 0b overhead 0b level 0 
Sent 5229133 bytes 11151 pkt (dropped 0, overlimits 0 requeues 0) 
rate 0bit 0pps backlog 0b 0p requeues 0 
lended: 10898 borrowed: 0 giants: 0
tokens: 169125 ctokens: 9933

class htb 1:30 root prio 0 quantum 87500 rate 7000Kbit ceil 17000Kbit linklayer ethernet burst 1598b/1 mpu 0b overhead 0b cburst 1598b/1 mpu 0b overhead 0b level 0 
Sent 24636498 bytes 27360 pkt (dropped 0, overlimits 0 requeues 0) 
rate 0bit 0pps backlog 0b 0p requeues 0 
lended: 26923 borrowed: 0 giants: 0
tokens: -19199 ctokens: 3823

class htb 1:40 root prio 0 quantum 12500 rate 1000Kbit ceil 17000Kbit linklayer ethernet burst 1600b/1 mpu 0b overhead 0b cburst 1598b/1 mpu 0b overhead 0b level 0 
Sent 11785726 bytes 84162 pkt (dropped 0, overlimits 0 requeues 0) 
rate 0bit 0pps backlog 0b 0p requeues 0 
lended: 84162 borrowed: 0 giants: 0
tokens: 188000 ctokens: 11044

What's wrong? Can you help me? Thank you guys!

1 Answer 1

1

Your leaf class are attached to 1:0 instead of 1:1, so the parent has no available bandwidth to borrow.

Set your leaf classes to "parent 1:1" and it should be good.

1
  • Hey Sanael, thank you so much man! This really was the problem...
    – jhansen
    Apr 13, 2016 at 12:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .