I have a use-case where egress traffic on 10Mbps connection needs to be divided into two classes. First class is high-priority traffic which needs to be able to use bandwidth up to 10Mbps. Second class is low-priority traffic which can use the amount of bandwidth left from the high-priority traffic. I could do this in a following way:
tc class add dev eth0 parent 1: classid 1:1 htb rate 10mbps ceil 10mbps tc class add dev eth0 parent 1:1 classid 1:10 htb rate 10mbps ceil 10mbps tc class add dev eth0 parent 1:1 classid 1:11 htb rate 1kbps ceil 10mbps
High-priority traffic is filtered to class with handle
1:10 and low-priority traffic is filtered to class with handle
1:11. As seen above, low-priority traffic has only 1kbps guaranteed traffic and it has to "borrow" traffic from the parent(
1:) if it has bandwidth to spare.
1kbps seems like an hack. Are there any disadvantages of using very low "rate" value for Linux HTB queuing discipline? Is there a more elegant way to achieve this?