Hi Torproject,
i think about enabling AvoidDiskWrites 1 on all my relays and not only on my Pi because the prices for the VPS are anyway cheap as f*ck so i think saving the provider a few disk writes is a nice deal.
In the manual it is described as: *AvoidDiskWrites* *0*|*1* If non-zero, try to write to disk less frequently than we would otherwise. This is useful when running on flash memory or other media that support only a limited number of writes. (Default: 0)
... which is not a very informative description on how it changes the behavior of Tor. I didnt found any more explanation about it.
I would like to understand what Tor is NOT writing to disk anymore if set to 1 or what Tor IS writing to disk if set to 0 and if changing that have any effect for Tor users. As a relay operator i couldnt really see any difference enabled or not.
Kind regards
On Sat, Aug 24, 2019 at 06:36:20AM +0200, Michael Gerstacker wrote:
I would like to understand what Tor is NOT writing to disk anymore if set to 1 or what Tor IS writing to disk if set to 0 and if changing that have any effect for Tor users. As a relay operator i couldnt really see any difference enabled or not.
It doesn't make Tor write different things to disk. Rather, it controls how often Tor checkpoints its files to disk.
For example, your 'state' file (in your DataDirectory) is where Tor keeps track of some of its local statistics and configuration, like how many bytes it has spent from your AccountingMax, and it writes that file to disk periodically in case something goes wrong (e.g. the computer turns off suddenly).
Tor doesn't write the file immediately after a change, though, because often changes come in batches, so it waits a little while before writing it. When AvoidDiskWrites is set, it waits longer. So the same files get written to disk eventually, but there's a higher risk of losing some changes if something goes wrong before it gets around to writing out the file.
As for what files Tor writes, we tried to cover that in the "FILES" section at the end of the Tor man page ("man tor"). That documentation might be out of date though, so if you notice anything else, please do file a ticket.
And as a last note, I think it's been a long time since anybody tuned AvoidDiskWrites to have actually reasonable parameters. I wrote it long ago as a potential feature that somebody might find useful, and I just picked some numbers that seemed plausible back in 2007.
--Roger
On 25 Aug 2019, at 21:45, Roger Dingledine arma@torproject.org wrote:
And as a last note, I think it's been a long time since anybody tuned AvoidDiskWrites to have actually reasonable parameters. I wrote it long ago as a potential feature that somebody might find useful, and I just picked some numbers that seemed plausible back in 2007.
Since 2007, we've seen some significant technological changes: * More devices with batteries * More devices with SSDs * Better disk forensics techniques
So it might be a good idea to change the client default to AvoidDiskWrites 1: https://trac.torproject.org/projects/tor/ticket/31507
T
tor-relays@lists.torproject.org