Htb

HTB 類不借用可用頻寬

  • April 13, 2016

我正在使用 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,ceil 為 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:0 而不是 1:1,因此父級沒有可藉用的頻寬。

將您的葉子類設置為“父級 1:1”,它應該很好。

引用自:https://serverfault.com/questions/769487