Difference between HTB Rate and Ceil Values

Rate is the rate they will be allowed to allocate when bandwidth is tight. However, when bandwidth isn't tight, HTB allows classes to "borrow" bandwidth from other classes. Ceil limits how much they can borrow. Lets say you have this:

tc class add dev eth0 parent 1: classid 1:1 htb rate 90kbps ceil 90kbps
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 30kbps ceil 60kbps
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 30kbps ceil 60kbps
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 30kbps ceil 60kbps

If all classes 1:10,1:11,1:12 are trying to send as much as possible, they will be allowed to send their allowed 30kbps. If, in contrast, 1:10 is the only one sending. It would be allowed to borrow some of the parents bandwidth, since its siblings aren't using it, but it won't be able to use all 100kbps, it will only be able to use 60kbps, because it is limited by ceil.

You can think of it this way. You have to spend tokens in order to send bandwidth. The rate is how fast you are given tokens to spend. The ceil is how many of your siblings unused tokens you are allowed to borrow.