HTB 类不借用可用带宽

HTB 类不借用可用带宽

我正在使用 iptables + htb 来调整互联网流量的带宽。我有一个 17mbit DSL 链接。实际上,我设置了以下规则:

# 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

HTTP/HTTPS 类仅适用于我们的外部专用服务器。这些服务器的 HTTP/HTTPS 流量很高,因此我保证最低速率为 7mbit,上限为 17mbit。但问题是,当其他类未充分利用其带宽时,HTTP/HTTPS 类不会将其速率提高到 17mbit。所有类都发生了这种情况。查看命令“tc -s -d class show dev eth0”的结果

确保任何类别都不会“借用”其他类别的可用带宽。

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

怎么了?你能帮我吗?谢谢大家!

答案1

您的叶类连接到 1:0 而不是 1:1,因此父类没有可用带宽可供借用。

将您的叶类设置为“父级 1:1”,这样应该很好。

相关内容