[tor-relays] max / burst speed

Rick Huebner rhuebner at radiks.net
Tue Sep 27 23:57:46 UTC 2011


On 9/27/2011 1:37 PM, tor-relays-request at lists.torproject.org wrote:
> No idea what shaping algorithm Tor uses, nor any clue on recommended
> burst ratios under said algorithm. Anyone???.
I believe Tor uses a token bucket algorithm 
(https://secure.wikimedia.org/wikipedia/en/wiki/Token_bucket) for 
traffic shaping.  Which works sort of like a fuel tank with a steady 
rate of fuel being replenished each second (RelayBandwidthRate) and a 
max capacity of RelayBandwidthBurst bytes.  If the tank is full, up to 
RelayBandwidthBurst bytes can be consumed, but only RelayBandwidthRate 
bytes will be replenished each second.  So there's a sort of reserve 
available of Burst - Rate bytes, and consumption > Rate bytes/second 
depletes the reserve, and consumption < Rate refills the reserve, up to 
the max capacity.

In general I think the higher the Burst you can allow, the better; it 
helps fast clients with small requests to zip through your relay quickly 
without clamping them to your overall Rate limit, and doesn't cost you 
anything since your long-term average is still enforced (bursts over 
your limit are balanced with slack periods under your limit).  But I'm 
not clear on what the highest effective value would be.  I could even 
see a point to having the Burst higher than your physical connection's 
actual limit, e.g. setting it to 10 times your connection's actual limit 
would allow bursts to max out your connection for 10 seconds 
(occasionally, to be balanced again by slack periods under your rate).  
But really, I doubt that values more than 2 or 3 times your Rate limit 
will actually matter, since Tor traffic doesn't seem to often come in 
those kinds of isolated high-multiple bursts (probably the natural 
averaging effect of having many clients routing dozens/hundreds? of 
circuits though your relay at once).  A simple pragmatic test might be 
to run the Vidalia bandwidth meter for a day or two, and if the peak 
rate isn't hitting your Burst, it's high enough not to matter.

One interesting side effect of a high Burst might be its impact on the 
way your relay's bandwidth is measured by the official bandwidth 
scanners, though.  If the bandwidth scanner's test download file is 
small enough (less than many second's worth of your overall Rate limit 
bandwidth), a high Burst might allow the test file to be downloaded much 
more quickly than with a low Burst, raising your official measured 
bandwidth rating (and drawing more traffic to your relay).  Larger test 
download files would mitigate this, but increase the scanner's workload 
and time between each relay's re-scans.  Just a thought, I don't know 
how much effect this actually has.



More information about the tor-relays mailing list