我发现沿着 tc 有用的 run watch,例如:
[root@router ~]# watch -dc tc -p -s -d qdisc show dev eth0
Every 2,0s: tc -p -s -d qdisc show dev eth0 Sat Oct 19 21:22:26 2013
qdisc prio 1: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent 130714882 bytes 1107132 pkt (dropped 20379, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 30: parent 1:2 limit 127p quantum 1514b flows 127/1024
Sent 775116 bytes 1466 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc tbf 20: parent 1:3 rate 100000bit burst 1600b/8 mpu 0b lat 70.0ms
Sent 30679 bytes 119 pkt (dropped 170, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
Run Code Online (Sandbox Code Playgroud)
我想知道为什么所有情况下的比率都是 0....为什么?请您向我推荐一些解释 tc show 输出的文档吗?
另外,显示输出有点神秘,请您推荐我一些解释类似以下内容的文档:积压,
我发现了这个流量控制资源列表,这可能有助于您获得有关该主题的足够的领域知识。文章标题为:交通管制。
还有关于 QoS 和流量控制的优秀教程,标题为:Journey to the Center of the Linux Kernel: Traffic Control, Shaping and QoS。
您可能还想了解一下标题为“网络流量控制”的 OpenWRT 文档。具体来说,本节是关于配置的。他们讨论了流量控制的工作原理、如何配置它,并为术语和示例提供了良好的基础,这应该有助于更好地理解一切是如何工作的。
最后,我还找到了这篇文章,标题为:HTB Linux 排队纪律手册 - 用户指南,其中对速率做出了以下评论。他们在这里谈论的是班级率,但我认为两者足够相似:
摘抄
$ tc -s -d class show dev eth0
class htb 1:1 root prio 0 rate 800Kbit ceil 800Kbit burst 2Kb/8 mpu 0b
cburst 2Kb/8 mpu 0b quantum 10240 level 3
Sent 5914000 bytes 11828 pkts (dropped 0, overlimits 0)
rate 70196bps 141pps
lended: 6872 borrowed: 0 giants: 0
class htb 1:2 parent 1:1 prio 0 rate 320Kbit ceil 4000Kbit burst 2Kb/8 mpu 0b
cburst 2Kb/8 mpu 0b quantum 4096 level 2
Sent 5914000 bytes 11828 pkts (dropped 0, overlimits 0)
rate 70196bps 141pps
lended: 1017 borrowed: 6872 giants: 0
class htb 1:10 parent 1:2 leaf 20: prio 1 rate 224Kbit ceil 800Kbit burst 2Kb/8 mpu 0b
cburst 2Kb/8 mpu 0b quantum 2867 level 0
Sent 2269000 bytes 4538 pkts (dropped 4400, overlimits 36358)
rate 14635bps 29pps
lended: 2939 borrowed: 1599 giants: 0
Run Code Online (Sandbox Code Playgroud)
然后他们对速率和 pps 的解释如下:
速率,pps 告诉您上课的实际速率(平均 10 秒)。它与门控使用的速率相同。