It seems good to me.
I have a almost same setup and it works fine.
The only things i have different are the following
Code:
tc qdisc add dev eth0 root handle 1: htb default 12
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 9mbps ceil 10mbps
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 40kbps ceil 40kbps
tc qdisc add dev eth0 parent 1:10 sfq
tc qdisc add dev eth0 parent 1:12 sfq
I don't know if it makes any difference but don't give the full 1:1 bandwidth to 1:10 that is why i changed yours to 9.
Second, you didn't set any queue for the classes. (I think this is needed but very long time has passed since i have set it up, so i can't
remember, maybe i am wrong, but try it anyway)
I used the SFQ queue but you can use any one you want (SFQ is good though)
Another thing you can do instead of all the port matching, use the firewall classifier.
that is you mark the packets with iptables and then you choose the iptables mark for matching.
For example
Code:
tc filter add dev eth0 parent 1:0 protocol ip prio 1 handle 7 fw flowid 1:10
iptables -t mangle -A POSTROUTING -p tcp --dport 80 -j MARK --set-mark 7
This is the same as your approach. It will have the same effect, i just find it easier to mess with iptables.