Changes between Version 86 and Version 87 of doc/FireFoxTorPerf


Ignore:
Timestamp:
Apr 23, 2010, 4:47:55 AM (9 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/FireFoxTorPerf

    v86 v87  
    55Tor is known for being secure but slow. If you want to improve browsing speed a bit, please follow the following simple instructions for tweaking the Firefox web browser's settings:
    66
    7 == Procedure 1 ==
     7== Procedure ==
    88
    99First, open Firefox's advanced settings menu by running ''about:config'' from the address bar. Upon entering this address, you will see a long list of internal settings. Modify the following ones and set them to the suggested values shown here for maximum performance:
    1010
    1111{{{ network.http.keep-alive.timeout:600 (300ms default is OK usually, but 600 is better.)
    12 network.http.max-persistent-connections-per-proxy:16 (Default is 4)
     12network.http.max-persistent-connections-per-proxy:16 (Default is 8?)
    1313network.http.pipelining:true (Default- false. Some old HTTP/1.0 servers can't handle it.)
     14network.http.pipelining.firstrequest:true (Default- false.)
    1415network.http.pipelining.maxrequests:8 (No default)
    1516network.http.proxy.keep-alive:true (Default- true, but double check)
    16 network.http.proxy.pipelining:true (Default- false) }}}
     17network.http.proxy.pipelining:true (Default- false)
     18network.http.proxy.keep-alive:true (Default- true, but double check) }}}
    1719
    18 Afterwards, just restart the browser and experience the difference! For some automated additional performance hacks, check out [http://www.totalidea.com/freestuff4.htm FireTune]. Currently, Fire``Tune is only for Win32, but you can do the same tweaks manually with the help of [http://www.tweakfactor.com/articles/tweaks/firefoxtweak/4.html this page]. Additionally, there is the [http://fasterfox.mozdev.org/ FasterFox extension] that is easy to install, and is also '''platform independent'''!
    19 
    20 == Procedure 2 - an update and addendum to Procedure 1 ==
    21 
    22 These results were arrived at empirically, using the win32 bundle, Tor & Privoxy & Vidalia bundle: 0.1.2.5-alpha
    23 
    24 You will need the following tools...
    25  * [http://freehaven.net/~squires/torbutton/ Tor Button]
    26  * [http://fasterfox.mozdev.org/ FasterFox]
    27  * [http://www.prnwatch.com/prio.html Prio (win32)]
    28  * [http://www.speedguide.net/downloads.php TCPOptimizer (win32)]
    29  * [http://www.speedguide.net/read_articles.php?id=1497 Event ID 4226 Patcher (win32)]
    30 
    31 == Tor Button - enable / disable TOR access in FireFox ==
    32 This provides an optional button or text in the bottom right of the browser window in Firefox. This allows you to switch Tor on and off.
    33 
    34 == FasterFox - Modify performance related settings in FireFox ==
    35 This plugin modifies the networking and cache settings for Firefox. The following settings need to be modified.
    36  * Initially you need to select 'Custom' in the FasterFox Options. This allows you to use your own detailed options, rather than the default schemes supplied.
    37  * Select the Cache tab.
    38   * Enter a Memory Cache Capacity of >= 8mb
    39   * Enter a Disk Cache Capacity of >= 8mb
    40  * Select the Connection tab
    41   * Enter Max Connection >= 128
    42   * Enter Max Connection Per Server >= 10
    43   * Enter Max Persistent Connection Per Server >= 8
    44   * Enter Max Persistent Connection Per Proxy >= 8
    45  * Select the Pipelining tab
    46   * Ensure all 3 tick options are enabled
    47   * Enter Max pipelining requests >= 10
    48 
    49 == Prio - Increase Vidalia process Priority (win32) ==
    50 You will also realise a substantial increase in performance by increasing the process priority for the Vidalia process. You can do this in Task Manager after you identify vidalia.exe. If you want to persist the process priority you will need a Task Manager addon. This will allow the same process priority each time the OS loads Vidalia. An effective tool for doing this is [http://www.prnwatch.com/prio.html Prio]. This tool can only be used in a non-commercial setting, unless you license it.
    51 I dont recommend modifying the process above 'high'. If Vidalia crashes or freezes, the Windows OS will become unresponsive. Setting it to 'Above Normal' is a good start.
    52 
    53 == TCP/IP - Optimise 2K/XP's throughput (win32) ==
    54 Windows XP has a self-tuning IP stack, but it can still benefit from a little help. Using the TCP Optimiser tool from above you can tune the RWIN, SACK OPTS (rfc 2038), and tcp1323opts controlling window scaling. The tool has one button optimise. This setting is sufficient to benefit from immediate increases to Tor throughput. To increase throughput further you can try experimenting with lower values of the IP TTL (Time To Live). Values as low as 32 will work and result in improved performance. Also try experimenting with smaller TCPWindowSizes. This setting is automatically adjusted when you move the slider marked 'Connection Speed' of the TCPOptimizer  tool. Maximum throughput occurs when TCPReceiveWindow sizes < 65536 are applied. Currently theory is that above this size, TCP Receive Window Scaling comes into effect on Windows 2K/XP. The current theory is that TOR does not negotiate Scaling Receive Windows very well, which causes the IP stream to stall, reducing overall throughput.
    55 
    56 == Remove the limit on TCP connection attempts XP SP2 (win32) ==
    57 [http://www.speedguide.net/read_articles.php?id=1497 Remove the limit on TCP connection attempts] SpeedGuide.net has an interesting article detailing this restriction introduced in XP SP2. Microsoft have restricted the amount of half-open TCP/IP connections with the proviso that it would reduce the pace that worms spread. As noted by SpeedGuide, internet worms spread isotropically (multi-directionally) and so their infecton rate is exponential. As such, placing a constant (limit) on the rate of connection creation for every computer running XP SP2 will slow the rate of worms spreading (for that group of computers) but not by much. Consider the population of humans on the planet. Its over ~6 billion.
    58 
    59 Supposing all these people are running Windows XP SP2, with rate limited half-open connections. To infect the entire population of computers would take:
    60 We are assuming optimum forward infection here. In the first second we have infected 10 machines. The 2nd second to elapse will cause (10 x 10) + 10 = 110 computers to be infected. The 3rd second to elapse would cause:
    61  ( (10 * 10) * 10 ) + (10 * 10) =  1100 computers to be infected. So the number of computers infected for every second that elapses is :
    62  computers infected = ~ 10 ^ elapsedSeconds
    63 
    64 In 12 seconds, we would have 10 ^ 12 = 1 billion computers infected. Full infection occurs before 13 seconds have elapsed !
    65 
    66 This is all skewed by network topologies and routing algorithms, but they would affect a non-limited network in an identical manner. So the affect is a theoretical maximum of 13 seconds of additional notice to act against the worm. To all intents and purposes, this is useless.
    67 
    68 Of much more interest is the effect on ANY network that relies on many open connections, such as Tor and a host of P2P applications. The effect here is a slow down of communications, with the limit acting as the catalyst.
    69 
    70 Use the Event ID 4226 Patcher to mitigate against this.
    71 
    72 == DNS - reducing latency ==
    73 For faster DNS performance generally (on win32 only i'm afraid) see...
    74  * [http://www.analogx.com/contents/download/network/fc.htm AnalogX - FastCache]
    75 When TOR starts it will report if it is using localhost to resolve DNS addresses. When you install FastCache, it sets up a local, cached and persistent store of DNS addresses. DNS resolves cost TOR a lot in terms of latency. A large part of TOR's reduction in speed is caused by setting up the path to the Onion routers that are servicing the request. Reduce DNS latency and the time cost of setting up the TOR channels are reduced.
    76 
    77 Having completed testing, TOR addresses do appear in AnalogX FasterCache. FasterCache itself may prove unstable on occasion, with its icon stuck in its 'Red' - problem state. Try it and possibly update this page with your results.
    78 
    79 --- N.B. the effect of FasterCache on TOR is still undetermined, although the 'DNS latency reduction' theory still applies.
    80 Also for all OS'es see...
    81  * [http://www.opendns.com/ OpenDNS]
    82 
    83 == The proof is in the pudding ==
    84 
    85 With the changes made from Procedure 2, you can realise a sustained throughput of >100k, peaking at ~200k or more. These figures are based on the highest TOR bandwidth settings (>1.5mbps), through a 2mb connection. TOR at version 0.1.2.x uses an Asynchronous DNS resolver, the DNS tips above are still indeterminate for TOR traffic.
     20Afterwards, just restart the browser and experience the difference! For some automated additional performance hacks, check out [http://www.totalidea.com/freestuff4.htm FireTune]. Currently, Fire``Tune is only for Win32, but you can do the same tweaks manually with the help of [http://www.tweakfactor.com/articles/tweaks/firefoxtweak/4.html this page]. Also, this wiki site's documentation on [http://wiki.noreply.org/noreply/TheOnionRouter/SquidProxy Squid+Tor] is of some use for performance and anonymity reasons.