[tor-relays] [Relay] Hibernation Reset

teor teor2345 at gmail.com
Wed Jul 22 09:30:03 UTC 2015


> On 7/21/2015 11:09 AM, teor wrote:
>> 
>>> On 21 Jul 2015, at 03:12 , Tor Operator <tor at coldnorthadmin.com <mailto:tor at coldnorthadmin.com>> wrote:
>>> 
>>> Hi gents,
>>> 
>>> I rencetly had one of my relay fall into hibernation. It seems that simply restarting the service doesn't change the hibernation status since Tor is still thinking that the BW limits have been overrun. Is the proper method to reset the status of the node is simply to delete the "state" file in "/var/lib/tor/". For now, I just set back to 0 the "AccountingBytesReadInInterval" and "AccountingBytesWrittenInInterval" counters and the node was able to wake up but that doesn't seem like a very elegant way to do it.
>> 
>> Why not edit or remove the accounting limits in the torrc?
>> We might need a little more context: why are the accounting limits set lower than you want?
>> What exactly are you trying to achieve?

> On 22 Jul 2015, at 15:30 , Tor Operator <tor at coldnorthadmin.com> wrote:
> 
> Here goes.
> 
> The relay was configured to turn off when 1TB of traffic was reached. It did so way faster than I anticipated. Moreover, my VPS host actually doesn't count inbound traffic as part of my monthly limit. Since a TOR relay traffic is mostly symmetric, it does mean that BWAccounting will still consider the inbound traffic as part of the hard-limit.

We have a ticket logged to add accounting rules "in" and "out", but no-one has submitted a patch yet.

#15989 (Add AccountingRule in and out)
https://trac.torproject.org/projects/tor/ticket/15989

> The old configuration was :
> AccountingRule sum
> AccountingMax 1000 GBytes
> 
> That was obviously a mistake since the "sum" method meant that I would hit the hard-limit really quickly. Here is the current configuration that I'm testing. What I want is simply to reset the accounting cycle on the first of every month. The max statement should allow me to use 1.5TB~ of data (750 GB inbound / 750 GB outbound) :
> 
> AccountingRule max
> AccountingStart month 1 00:00
> AccountingMax 750 GBytes
> 
> Now, since accounting also tracks the "old" data, is there a way to "start anew"? To reset the data accumulated so far?

Recent versions of Tor record the "in" and "out" amounts in the state file, then calculate the "sum" or "max" when applying the rule. Are you using a version which doesn't do this?

I have in my state file:
AccountingBytesReadInInterval 1…
AccountingBytesWrittenInInterval 1…

But you're right, we also need a way of resetting the bandwidth once. Adding command-line arguments such as AccountingSetRead/Written would seem to be the way to go.
I've added a ticket for this:
https://trac.torproject.org/projects/tor/ticket/16636

For the moment, there are two workarounds:
* Set the reset time for 2 minutes time, send a HUP to Tor, let it reset, then set the reset for the first of the month, and send another HUP
* Stop Tor, edit the state file manually, and remove all the "Accounting" lines, and start Tor

Tim

Tim Wilson-Brown (teor)

teor2345 at gmail dot com
pgp ABFED1AC
https://gist.github.com/teor2345/d033b8ce0a99adbc89c5

teor at blah dot im
OTR D5BE4EC2 255D7585 F3874930 DB130265 7C9EBBC7

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-relays/attachments/20150722/6502f441/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.torproject.org/pipermail/tor-relays/attachments/20150722/6502f441/attachment.sig>


More information about the tor-relays mailing list