[tor-relays] Rate setting in tor

teor teor2345 at gmail.com
Fri Sep 8 07:57:10 UTC 2017


On 8 Sep 2017, at 17:15, r1610091651 <r1610091651 at telenet.be> wrote:
> On Fri, 8 Sep 2017 at 07:19 Roger Dingledine <arma at mit.edu> wrote:
>> On Fri, Sep 08, 2017 at 07:14:58AM +0200, Andreas Krey wrote:
>> > On Thu, 07 Sep 2017 22:56:17 +0000, r1610091651 wrote:
>> > > RelayBandwidthRate 2048 KBytes
>> > > RelayBandwidthBurst 2048 KBytes
>> > >
>> > > But using arm, I'm seeing that tor is not honoring these settings, with
>> > > bursts frequently exceeding the value.
>> >
>> > That's the point of the Burst - there is a bucket that is
>> > filled up with unused bandwidth, up to the Burst value,
>> > and before the relay throttles down to RB-Rate it also
>> > lets as many byte pass as the bucket currently has.
>> >
>> > Means that with your setting your relay can pass up to
>> > 4 MByte in any given second (but not in every second).
>> 
>> No, with these values the relay will push up to 2MBytes in each direction
>> each second. When the Burst is the same as the Rate, it's essentially
>> just like you're using the Rate. It doesn't add them.
>> 
>> My guess is that the original poster is confused because they wrote
>> "KBytes" in their torrc, but arm defaults to bits.
>> 
>> ...
> 
> ...
> 
> I indeed intend to limit both up & down traffic, through the relay. There is no local / client traffic, only relayed.

There is always client traffic, because directory mirrors fetch
two 1-2MB directory documents every hour or two. And relays fetch
descriptors and microdescriptors when they first start, when they
change, and when they expire.

> On 8 Sep 2017, at 10:54, Scott Bennett <bennett at sdf.org> wrote:
> 
>> client traffic also includes directory
>> document downloads
> 
> Directory fetches used to be counted as part of the relay operations
> traffic.  When did that change, please?

Since the relay bandwidth feature was introduced in tor-0.2.0.1-alpha,
connection_counts_as_relayed_traffic() has always counted relay
directory fetches and relay service to clients in BandwidthRate, and
relay service to clients in RelayBandwidthRate.

What did change in 0.2.8 or 0.2.9 is that relays started fetching
directory documents over OR connections. When a relay uses an OR
connection for any client traffic, all the traffic on the connection
is counted as "client" traffic for 30 seconds.

> I'm aware that the rate is in kilobytes. Also note that latest arm also reports in kilobytes/s.
> I was also able to verify rates reported by arm, by other network monitoring means.
> Just grabbed arm view:
> <image.png>
> And associated network view:
> <image.png>
> 
> Basically what I'm seeing is that tor ignores relay burst rate setting for relayed traffic.
> 
> Based on your comments, what I'm doing is correct way of rate configuration. Right?
> So it's a bug then?

Apart from the client traffic I mentioned above, this could also be a
measurement issue.

global_write_bucket_low() allows Tor to exhaust its bucket in the last
part of one second, and then exhaust the refilled bucket in the first
part of the next second.

So, if your measurement seconds are offset from tor's bucket refill
seconds, you will sometimes see one second that exceeds the burst, and
a lower second before or after it.

I wouldn't worry about it.

Or, if what you're trying to achieve is to never exceed a certain amount
for any second measured at any offset, halve that amount, and set it as
the BandwidthBurst.

T

--
Tim Wilson-Brown (teor)

teor2345 at gmail dot com
PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B
ricochet:ekmygaiu4rzgsk6n
xmpp: teor at torproject dot org
------------------------------------------------------------------------



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.torproject.org/pipermail/tor-relays/attachments/20170908/11639a88/attachment.sig>


More information about the tor-relays mailing list