[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Switching Tor relay speed

     On Sun, 22 Feb 2009 05:48:30 +0100 slush <slush@xxxxxxxx> wrote:
>Hi, I discuss to running high capacity Tor node on my univerzity in Czech
>Republic. There is plenty of connectivity during night, but less during day.
>In asking you, if you see any problem in switching tor speed automatically
>during day period.
>More information:
>Im using that on my home server. I have two torrc files, one with high
>RelayBandwidthRate (100kB/s) for times when Im not online (night and longer
>part of day) and one with less speed around 20kB/s for times Im online and
>working . I dont want to switch off tor completely, because people then
>cannot connect my node and also node's uptime is low when Im switching them
>on/off often ;).
>Im switching configuration file in bash by calling /etc/init.d/tor reload
>and it is working like a charm for me. But I know it is not the best
>solution for users, because their tors expect that my node's throughput is
>much more higher than it really is at the moment when Im online.
>And Im asking you what happen, when this difference in speed is not 100 - 20
>= 80kB/s, but for example 3000 - 100 = 2800 kB/s. I expect it will lead to
>slow down clients and overload of this relay, because everybody will expect
>for long time that there is much better throughput than really is. So....

     I think this is a situation many of us have encountered at one time or
another, though it hasn't come up on this list in quite a long time.  I've
mentioned here before that there are a number of serious problems with the
way tor handles data rate information, and your situation is directly related
to the problem of including the data rate information in the relay descriptor
published to the authorities, rather than through some separate, more
efficient reference method.  I keep hoping that sometime soon I will find the
time and energy to write something up that will describe each of the problems
I've thus far identified regarding reporting of data rates in tor and some
suggestions for correcting them, but other matters have kept getting in the
way of my doing that. :-(  In the meantime, a few notes applicable to your
situation in particular follow.
     The problem with frequent updates to the descriptor just to report changes
in the data rate information, whether a limit or an observation, is that each
update involves:

	- building a connection, either direct or tunneled, to each of the
	  authorities, and as we all know, there is considerable overhead
	  involved at all levels in building TCP connections and far more in
	  building tor circuits

	- transmitting the descriptor, consuming resources
	  of each authority and each circuit node to accomplish that

	- each time a tor instance, whether a relay or merely a client, fetches
	  a new status or consensus document, it will then notice that your
	  relay's descriptor has a new version, so that instance will have to 
	  fetch the new descriptor as well; there are typically around 1100 to
	  1200 relays on the air at any given time and untold numbers of
	  clients connected to them, all of which will have to fetch the new
	  descriptor, just to learn about the newly published data rate
	  limit(s), which relays don't care about anyway but have no way of
	  knowing in advance that that is all that has changed; only clients
	  (and directory authorities:-) care about data rate information

	- until a client gets a new status or consensus document, it doesn't
	  know that the descriptor has changed; recent versions of tor often
	  skip asking for new documents for an hour or two in order to reduce
	  the load on directory servers and the tor network in general that
	  is expended on tor directory information, i.e., purely tor overhead;
	  out-of-date rate information leads to misallocation of resources
	  via the statistical distribution used in circuit route selection,
	  the flip side of which is the slow, spread-over-time reaction to
	  the changes as observed at your relay, just as you mentioned

	- depending upon what your torrc says, fetching directory information
	  may involve building one or more circuits to directory servers, as
	  opposed to fetching the information in the clear from a directory
	  server's DirPort, which entails more tor network overhead every time
	  it happens

	- publishing roughly every 18 hours a complete new descriptor where
	  nothing but the data rate fields and the publication date have
	  changed, followed by fetches of the new descriptor by every active
	  client around the planet, which might include tens of thousands
	  these days, seems wasteful of tor network resources and unnecessary
	  in principle
>1) How often tor client updates his relay database? Quick updates can
>reflect these changes in topology/speeds.

     Roger or Nick could answer the client update frequency question better
than I because I haven't dug around in the code to discover the algorithm used.
See above regarding frequent publication of relay descriptor updates.

>2) Will it cause to any problematic behaviour or it is OK and I shouldnt
>solve this?

     Again, please see above.  OTOH, if you have to do it, there is currently
not much you can do to avoid the costs. :-(
>All speeds - 3Mb/s and 100kB/s are only illustrative. Im not sure what I
>will vindicate and I dont want to run Tor during day too much, because
>slower internet can lead to protests agains tor installation.

     Hmmm...now that I've written that brief list of thoughts above, I think
I'll save it as a tiny starting point for a more complete description of data
rate reporting problems, so you may see it again someday. :-)

                                  Scott Bennett, Comm. ASMELG, CFIAG
* Internet:       bennett at cs.niu.edu                              *
* "A well regulated and disciplined militia, is at all times a good  *
* objection to the introduction of that bane of all free governments *
* -- a standing army."                                               *
*    -- Gov. John Hancock, New York Journal, 28 January 1790         *