[tor-relays] big spike in cpu usage

Andreas Krey a.krey at gmx.de
Mon Apr 8 17:41:47 UTC 2013


On Mon, 08 Apr 2013 08:47:56 +0000, Sebastian Hahn wrote:
> 
...
> Now, it's entirely possible I'm missing something big here; or that the
> code changed and now does something different; or that it used to do
> something different, etc. Andreas, can you please explain more?

At least the original change explains different:

+--- ReleaseNotes -----
| 
Changes in version 0.0.2pre20 - 2004-01-30
| ...
| 
|     - I've split the TotalBandwidth option into BandwidthRate (how many
|       bytes per second you want to allow, long-term) and
|       BandwidthBurst (how many bytes you will allow at once before the cap
|       kicks in).  This better token bucket approach lets you, say, set
|       BandwidthRate to 10KB/s and BandwidthBurst to 10MB, allowing good
|       performance while not exceeding your monthly bandwidth quota.
+---------------------

..which is pretty much my usage scenario, just with smaller numbers.

And the code looks likewise. We have the global_*_buckets that are
initialized from *BandwidthBurst, and get incremented regularly by
*BandwidthRate (divide by increment frequency; TokenBucketRefillInterval)
and then capped to the *BandwidthBurst.

Thus *BandwidthBurst ist the total amount of unused traffic we can
save up to later fire with more than *BandwidthRate. No 'per second'.

(The interesting part is that the global_*_bucket are ints;
 much more than the 1 GB default could behave strangely.)

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800


More information about the tor-relays mailing list