Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've found useful run watch along tc, for example:

[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

I've wonder why rate in all cases is 0.... why? Please could you recommend me some documentation that explains tc show output?

Also, the show output is somewhat cryptic, please could you recommend me some documentation that explain something like: backlog,

share|improve this question

2 Answers 2

I found this list of traffic control resources which might prove helpful to you in gaining enough domain knowledge about the topic. The article is titled: Traffic Control.

There is also this excellent tutorial on QoS and Traffic Control, titled: Journey to the Center of the Linux Kernel: Traffic Control, Shaping and QoS.

You also might want to take a peak at this OpenWRT documentation titled: Network Traffic Control. Specifically this section on Configuration. They discuss how Traffic Control works, how to configure it, and also provide a good basis for the terminology along with examples, which should prove helpful in getting a better understanding of how everything works.

Lastly, I also found this article, titled: HTB Linux queuing discipline manual - user guide, which makes the following comment about rate. Here they were talking about class rate but I think the two are similar enough:

excerpt

$ 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

They then explain rate and pps as follows:

rate, pps tells you actual (10 sec averaged) rate going thru class. It is the same rate as used by gating.

References

share|improve this answer
    
Thanks for the resources, But I still haven't found even read them why in the real example shown above rate is 0bit in all cases! Any ideas? TIA –  sebelk Oct 20 '13 at 15:27

It seems that from 12.04 distro of Ubuntu, rate and backlog stats on htb are always 0. I think the rate estimators in these distros are not enabled by default because, if you have too much htb classes it could consume much CPU resources.

Try to do as root once sch_htb module has been loaded

echo 1 > /sys/module/sch_htb/parameters/htb_rate_est

After giving the above command, replace your htb tree. This works for me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.