wiki:doc/FireFoxTorPerf

Version 32 (modified by trac, 9 years ago) (diff)

--

Hacking Firefox for Maximum Performance with Tor

Introduction

Tor 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:

Procedure 1

First, 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:

{{{ network.http.keep-alive.timeout:600 (300ms default is OK usually, but 600 is better.) network.http.max-persistent-connections-per-proxy:16 (Default is 4) network.http.pipelining:true (Default- false. Some old HTTP/1.0 servers can't handle it.) network.http.pipelining.maxrequests:8 (No default) network.http.proxy.keep-alive:true (Default- true, but double check) network.http.proxy.pipelining:true (Default- false) }}}

Afterwards, just restart the browser and experience the difference! For some automated additional performance hacks, check out FireTune. Currently, FireTune is only for Win32, but you can do the same tweaks manually with the help of this page. Additionally, there is the FasterFox extension that is easy to install, and is also platform independent!

Procedure 2 - an update and addendum to Procedure 1

These results were arrived at empirically, using the win32 bundle, Tor & Privoxy & Vidalia bundle: 0.1.2.5-alpha

You will need the following tools...

Tor Button - enable / disable TOR access in FireFox

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.

FasterFox - Modify performance related settings in FireFox

This plugin modifies the networking and cache settings for Firefox. The following settings need to be modified.

  • 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.
  • Select the Cache tab.
    • Enter a Memory Cache Capacity of >= 8mb
    • Enter a Disk Cache Capacity of >= 8mb
  • Select the Connection tab
    • Enter Max Connection >= 128
    • Enter Max Connection Per Server >= 16
    • Enter Max Persistent Connection Per Server >= 8
    • Enter Max Persistent Connection Per Proxy >= 8
  • Select the Pipelining tab
    • Ensure all 3 tick options are enabled
    • Enter Max pipelining requests >= 16

Prio - Increase Tor process Priority (win32)

You will also realise a substantial increase in performance by increasing the process priority for the Tor process. You can do this in Task Manager after you identify tor.exe. If you want to persist the process priority you will need a Task Manager addon. An effective tool for doing this is Prio. This tool can only be used in a non-commercial setting, unless you license it. I dont recommend modifying the process above 'high'. If Tor crashes or freezes windows will become unresponsive. Setting it to 'Above Normal' is a good start.

DNS - reducing latency - DOES NOT AFFECT TOR - for general use

For faster DNS performance generally (on win32 only i'm afraid) see...

Also for all OS'es see...

The proof is in the pudding

With the changes made from Procedure 2, you can realise a sustained throughput of >100k, peaking at ~300k or more. These figures are based on the highest TOR bandwidth settings (>1.5mbps), through a 2mb connection. You will also experience much lower DNS latency in general for non TOR traffic. TOR at version 0.1.2.x uses an Asynchronous DNS resolver, the DNS tips above do not affect TOR traffic per se.