Free Computer Technical Support Environmentally Friendly Site
Free Computer Technical Support :: Fine Tuning Firefox cn fr de it jp kr pt ru es











Like this page?
Bookmark and Share

Share with StumbleUpon Share with Reddit Digg it and share
Bookmark with Del.icio.us

Fine Tuning Firefox

 

Introduction

Mozilla Firefox is considered one of the better browsers currently available. That said people always want to tweak the good stuff to make it better. In this article we look at how we can improve the performance of Firefox to get the most out of our internet connection, and make browsing a more pleasurable experience.

There are many such articles on the web that list settings to improve Firefox's performance, without any real explanation of what is being changed. Many of these articles copy verbatim settings from each other, and some of the settings are of questionable value. If such settings were generically good for improving the performance, then they would be set by default in Firefox. This article explains how someof the settings work and their implications. We give advice on settings, however there is no hard and fast rules, and you should experiment as every PC and internet connection setup is different.

Configuration

In order to tweak the software, we need to access it’s configuration interface. In Firefox, all we need to do is type about:config in the address bar, and press Enter. This should give you something like the following in Firefox:

Firefox Configuration

From this window we can change any settings. All we need to do is find the necessary setting, and double click on it to change it. This will either toggle it’s setting, or bring up a window for you to enter a setting of your choice.


Pipelining

The first thing we need to do is enable pipelining. Pipelining enables multiple HTTP requests to be sent, even before a response is received from the server. You should note that this setting may not work correctly with some servers that do not support pipelining, therefore you may need to disable this for some websites; however experience shows that virtually all websites work without problem.

In order for pipelining to work, the browser must be configured to use HTTP 1.1. This is in fact the default setting, however you should verify this by checking the setting network.http.version is set to 1.1 – if not, then change it. Another requirement for pipelining to work is the setting network.http.keep-alive is set to True. This setting means that the HTTP connection can be ‘kept alive’ for multiple requests, rather than only being used for a single request. Again, the default setting is True, so this should not have to be changed.

Pipelining has two settings, one for if you are using a proxy server, and one for if you are not. If you are unsure then you should set both of these to true to be on the safe side. The settings you need to change are network.http.pipelining and network.http.proxy.pipelining, and should be set to True.

Once pipelining is enabled, it is necessary to set the maximum number of requests to pipeline at once. This value can be from 1 to 8, where 1 is effectively disabling pipelining. The higher the value, the longer the delay will be before the first request completes, however the last request will finish sooner. So this means it will take longer to start to load the page, but the page will finish loading sooner. Also, if a connection fails, the time out period will be longer for higher values. We would recommend setting this value to 8, however you may experiment with different values.


Connections

The number of connections Firefox can make to servers will impact the speed at which it can retrieve information. However if this is too high, then it will slow the application down as it tries to manage all the connections. The network.http.max-connections setting controls the total number of connections that can be maintained at any one time. The default setting is 24. We recommend for dial up to set this to 32, and for broadband take 32 and add 2 for every 1mbps of connection speed you have (so for a 2mbps connection set to 36). You may experiment with this setting to find an optimum for you specific configuration.

You can also control the maximum number of connections to each server (although this will always be limited by the above total setting). This is controlled by network.http.max-connections-per-server and has a default of 8. This is fine for dial up, but add 1 for every 1mbps of connection speed you have for broadband. Note that if you are using a proxy server to retrieve information, this setting will limit the connections as all connections will be to the proxy server. In these instances, set this value to the same as network.http.max-connections.

You can also define the number of persistent connections, these connections can be reused for multiple requests and speed up data transfer. There are two settings network.http.max-persistent-connections-per-proxy for if you are using a proxy server and network.http.max-persistent-connections-per-server for if you are not. If in doubt set both of these. network.http.max-persistent-connections-per-proxy should be set to the same as network.http.max-connections-per-server and network.http.max-persistent-connections-per-server should be half this value, but should not exceed 10 (integers only, so round off if you are dividing an odd number).

Preventing Firefox from attempting to us IPv6 DNS lookup can also speed up browsing. The setting network.dns.disableIPv6 should be set to True to disable to IPv6 lookup. If you are on a network that uses IPv6, this should be left to False, however few networks currently use IPv6.


Page Rendering

Controlling how Firefox renders, or displays, the page can have an impact on how quickly it loads.

The setting content.notify.backoffcount controls how many times the page can be rendered while the page is loading. It renders what is available of the page at periodic intervals. If this setting is disabled (set to 0) then the page will not render until it has fully loaded; this will then consequently slow down the time it takes for the page to start to appear. If set to -1, then there is no limit on the number of times it reflows the page; this is the default setting. You can set this to any positive integer, and it will only reflow the page that many times. Reflowing slows down the overall page load time, however it speeds up the display of information. We recommend that this setting is set to 5, this way as the page loads, the start will be available more quickly, however the end will take longer to display, but overall the page should display quicker than if the setting is disabled. You can play with this setting to find an optimum for your preference. Please note that this setting relies on content.notifier.ontimer being set to True. Also, this setting does not exist by default, so you may need to create it by right clicking and selecting New -> Integer and setting the name to content.notify.backoffcount and the value to 5.

In order to set define the minimum time between reflows we can use the setting content.notify.interval. This is an integer value defining the number of microseconds (1 millionth of a second) between reflows. This setting does not exist by default, and will need to be created. If this is not set then the default is 120,000. It should not be set below 100,000 as this will seriously impact performance. Increasing this value will decrease the total loading time, but increase the perceived load time. As a rule of thumb, take the connection speed in bps (dial up is ~56,000bps, a 1mbps is ~1,000,000bps) and divide this by the processor speed of your computer in GHz. Use the value you get, for example a 2GHz PC with a 2mbps connection would be 1000000. If your value exceeds 1,000,000 then round down to 1,000,000; if the value is below 150,000 then round up to this value. Remember this is a guideline and you can experiment. Note that content.notify.ontimer must be set to True for this to have effect.

You can control how long it will be before the page starts to render from initially loading the page. This is controlled with the setting nglayout.initialpaint.delay. This setting is an integer value defining the number of milliseconds (1 thousandth of a second), the default value is 250. Many articles say to set this value to 0, however at this point in time there is no data to display, so this is a pointless exercise. The initial part of the page is made up of headers and does not display any useful information, so setting this value too low is counter productive. For broadband connections, we would recommend setting this not below 100, and for dial up leave at 250. The faster your connection the lower you can take this figure to get the initial part of the page displayed, you can experiment with this figure to optimise for your system.

You can determine the amount of time Firefox will be unresponsive while rendering pages using the setting content.max.tokenizing.time. This is an integer value representing the number of microseconds. This preference does not exist by default, and defaults to three times the value for content.notify.interval. We recommend that this ratio is maintained; so if you do have the value set, set it to three times the content.notify.interval value, or delete the value. Lowering this setting will make Firefox more responsive, but at the expense of page load times. The setting content.interupt.parsing needs to be set to True (or not exist, as this is its default value) for this to take effect.

Firefox needs to wait for a node before it can render part of a page, if a text heavy page with a long text node is being loaded, this can result in preventing the page from rendering. The setting content.maxtextrun can be used to determine where to split a text node so that the rendering can happen. This setting does not exist by default, but defaults to 8191. This is fine for most setups, however if you have a slow computer on a fast connection it may be beneficial to reduce this figure by as much as 50%. You can experiment with this setting.


Physical RAM Cache (KB)
32 MB 2048
64 MB 4096
128 MB 6144
256 MB 10240
512 MB 14336
1 GB 18432
2 GB 24576
4 GB 30720
8 GB and up 32768

Caching

When a page is loaded, it can be cached so that it does not need to be rerendered to be redisplayed, for instance if you go back to a page using the Back button. You can set the maximum amount of memory used to cache images and other interface elements using the browser.cache.memory.capacity setting. This is an integer setting that defines the size of the cache in kilobytes. This setting is not present by default. A setting of 0 disables caching, and -1 is the default setting where Firefox determines it’s own maximum based on the physical RAM in the system. The table on the right displays the defaults.

You should lower this setting if your computer’s performance is suffering due to low memory, however this will increase load times of previously visited pages. You can also increase this setting to improve performance, however it is not recommended to go beyond 10% of the total physical memory, as this will impact other applications and processes running on the PC. In order for this setting to take effect, bowser.cache.memory.enable must be set to True. If you want to experiment with this setting, putting about:cache?device=memory in the address bar will give the current memory cache usage.


User Interaction

If content.interupt.parsing is set to True (default), then the user can interact with a loading page (click links, etc.). If the page is not being interacted with, then Firefox checks for interactions less frequently, however once an interaction has been detected the frequency of checking increases to make the application more responsive to the user, but slows page load time. The time taken from the last interaction to returning to the less responsive mode where the page loads quicker can be changed with the setting content.switch.threshold. This is an integer value that represents the number of microseconds before returning to the less responsive mode. By default this setting does not exist and defaults to 750000. This value is fine for most PCs, however for slower PCs especially on slower connections you may wish to raise this to 1000000 to make the application more responsive during page loads. This will have an adverse affect on page load times however. You may wish to experiment with this setting. Please note content.interrupt.parsing and content.notify.ontimer must be set to True for this preference to take effect (they both are by default).


Summary

You should now have an idea of what settings can impact the performance of Firefox. We encourage you to experiment with these settings to see what works for your setup best in order to get the most out of Firefox with you setup.


Related Forum Posts

  1. FireFox 14 arrives
  2. Firefox 4 Released
  3. Firefox IE crashes
  4. Firefox buttons
  5. Firefox crashing again and again

Credits

Thanks to SoftStag for contributing this article.