The Truth About the Firefox “Pipelining” Trick

If you’re reading this blog, you probably use Firefox (77% of you, according to my analytics) and have possibly heard about the “pipelining” trick to speed up browsing. But does it really work? Yes…yes it does. But let me show you the right way to use it.

pipeliningIf you aren’t familiar with the trick, it claims to speed up your browsing in Firefox by opening up multiple “pipes,” allowing you to make multiple http requests to a web server, each pipe downloading a different part of the web page, then assembling them correctly at your browser.

Normally, HTTP requests are issued sequentially, with the next request being issued only after the response to the current request has been completely received. Depending on network latencies and bandwidth limitations, this can result in a significant delay before the next request is seen by the server.

HTTP/1.1 allows multiple HTTP requests to be written out to a socket together without waiting for the corresponding responses. The requestor then waits for the responses to arrive in the order in which they were requested. The act of pipelining the requests can result in a dramatic improvement in page loading times, especially over high latency connections.

The Problem

There’s really nothing wrong with the hack if done correctly. The problem lies in the (mis)communication of how to implement it. Most blogs you read are going to tell you to set the “network.http.pipelining.maxrequests” value to some huge number like 30, so you can make 30 http requests at once (I’ll let you know what that means later in the post, keep reading.) This is why that’s ridiculous:

  • Firefox only has the ability to send 8 requests at once, so altering this value to anything higher than 8 is pointless. Will it hurt anything if you set it that high? No, but it just shows you that the people who told you to do this don’t know what they’re doing.
  • Even if it could send 30 http requests at once, you wouldn’t want to set it that high. If everyone made 30 simultaneous http requests to every web server they connected with, the internet would be slow, webmasters would hate you (and Mozilla,) and your IP would probably be banned from many websites. There is a reason that this setting is turned off by default.
  • The higher you set this value, the more likely it is that you will break something. But don’t fret about it.

That being said, I love this feature, and use it to it’s fullest. I suggest you do the same, if it works well for you.

The correct way to use the Pipelining feature

Note: You must have a (preferably fast) broadband connection. If you have dial-up, stop reading, forget it, pipelining isn’t for you.

Also, if you don’t use Firefox, please download it. You won’t regret it:

In normal Microsoft fashion, Internet Explorer doesn’t support pipelining (even IE7)

  1. Open a new tab in Firefox (Ctrl+T) and type “about:config” (without the quotes) in your address bar.
  2. In the “Filter:” search box, type “network.http” (again, without the quotes.) You don’t have to hit enter.
    • Look for the “network.http.keep-alive” setting and make sure it’s set to “true”. If it’s “false,” double-click that line and it will change to true.
    • On the same page, look for “network.http.version” and make sure it’s set to “1.1”
  3. Now clear out the Filter box and type in “pipelining”
    • Look for “network.http.pipelining” Right-click on that line, and click on “toggle” and be sure the value is set to “true” (or double-click to toggle values.)
    • If you’re on a proxy, look for “network.http.proxy.pipelining” Right-click on that line, and click on “toggle” and be sure the value is set to “true”. If you don’t know if you’re on a proxy or not, just set it to “true” anyway. It won’t hurt anything.
    • Lastly, look for “network.http.pipelining.maxrequests” Right-click on that line, click on “modify” and set the value to 8. You can set it anywhere between 1 and 8. If you notice your internet is acting weird after this, try decreasing this value.
  4. Keep in mind that this may not agree with some web servers, and therefore break the webpage. I have not personally experienced this yet, but this feature is still in testing, and that’s why it’s not set to “true” by default.

There you have it. Ignore the sites telling you to set the value to “30.” Those same pages will also tell you to create a new value called “nglayout.initialpaint.delay” and to set that value to “0”. All this does is start displaying the information on the webpage sooner. nglayout.initialpaint.delay does not make your page load faster. In fact, it can make it load slower; especially on slower connections. If you create this value and set it to “0” you will notice the page beginning to render right away, but it will take longer to finish completely.

The final word

There are many little hacks in Firefox that you can perform, and I plan on covering many of them in future posts. The Mozilla guys have done a great job in making Firefox fast, and most of the time you will be happy with the default settings. But not all computers are the same, and they can’t predict that. There is a reason that many of these settings are set the way they are by default, and you should only change them if you know what the value actually does. Don’t listen to someone who says “change this random value in about:config, it will make your pages load faster” without explaining to you what the value actually does. That setting may work great for him, but may not work well for you.

Anybody have anything to add?

34 thoughts on “The Truth About the Firefox “Pipelining” Trick”

  1. I thought Mozilla and MSIE by default issued up to 4 requests at once. Years ago that’s what my Web performance monitor simulated, and it’s the default for network.http.pipelining.maxrequests in current Minefield. talks about tweaking MaxConnectionsPerServer settings for MSIE, and says it’s 4 for HTTP 1.0 servers and 2 for HTTP 1.1 servers.

    I can’t remember if browsers make multiple simultaneous requests to different servers, I think they used to. That was one motivation for companies to have as well as

    Keep-alive is important so the browser can issue the requests in a single TCP/IP conversation. It requires server cooperation to hold open the channel on the other end, and many sites get it wrong.

    Back in the day when everyone was on dial-up, sites would work to optimize performance. Not so much these days.

  2. I think you’re talking about browsers creating multiple connections to a web server (typically 2 these days as you say), whereas this is about issuing multiple requests to a single connection (or connections).

    Without pipelining, you’d get 2 connections and a request issued on each, then the browser waits for the replies. When it gets a reply on a connection, it can then issue the next request (and with keep-alive, hopefully not have to re-establish the connection).

    With pipelining it can issue up to 8 requests per connection all at once, then simply wait for the responses to come back in the order they were issued before issueing a new batch of (up to) 8.

    That’s my understanding anyway :)

  3. Pingback:
  4. Interesting. I remember when pipelining was introduced into Mozilla many many years ago. It sounded great, but I’ve never read articles telling you to use it (in fact, the articles I’ve read have said the opposite).

    I was under the impression that pipelining opened a connection and didn’t close that connection until everything was downloaded, so that it wouldn’t have to reconnect to the server for every request. I guess I misunderstood. Thanks for the clarification.

    Bummer about the dial-up. Ironically, it’s us bumpkins that are stuck with dial-up that need faster page downloading the most :( I guess tabs are still the best gift to us.

  5. Thanks for the article, very interesting. I didn’t know this feature, and I’ll sure test it carefuly.

    The first impression I had was very good. Websites are indeed reloading a bit faster here (I’m through a 2mbps link), and so far I have not faced any problem with a particular site.

  6. I had just learned about this from a friend and tried with the 30 number, and was having issues. Then I found your info, it is much better than what I’ve already found, and explains the idea better. Made the changes, and now I’m moving along quite nicely!

    THANKS !!

  7. Thanks for the explanation…I tried 8 but the webpages I usually visit took longer to response and I kept getting “Your connection was Reset” huh?!? Anyway I tone it down to 5 or 6 and see if it works better.


  8. I’ve found that the pipelining method really increases speed for sites hosted by free webhosts (especially my own). I haven’t seen a speed increase for other sites.

  9. Pipelining isn’t about opening multiple simultaneous connections to the webserver; it’s about sending multiple requests in a single connection (and possibly even a single packet) without waiting for response for each one.

    The frustrating thing is that it’s hardly ever used because *some* webservers which pretend to support HTTP 1.1 don’t support pipelining, even though they’re *required* to according to the HTTP 1.1 spec (browsers aren’t required to, only servers), and since it’s supposed to be assumed that they support it, there’s no good way to tell whether one does or not, so browsers like FireFox tend to play it safe and a) disable pipelining by default, and b) use heuristics to determine whether to use it when it’s enabled.

    Wikipedia says that most webservers support it, and as the only exceptions lists a couple of versions of IIS. So I’m thinking maybe we can thank Microsoft for doing things their own way as usual – whatever’s convenient for them – thus preventing web browsing from becoming much faster and more efficient for everyone.

    I suppose it would have been better if they had anticipated that some people (like Microsoft) would screw it up and made pipelining optional and included a spec to indicate whether it’s supported in the http header. But I guess hindsight’s 20/20.

  10. Just moved from FF to 3.0 RC1 – it’s very fast even without the pipelining tweak.

    Enabled pipelining and works very well with most websites except banking sites it seems.

    Suggest you try logging into your bank account with pipelining enabled to see what happens.

    My bank site jams up with pipelining enabled so I’ve gone back to the default mode.

    The rendering speed of FF 3.0 should help the speed freaks – currently 10x faster than IE7.

  11. When I enabled pipelining in Firefox there was no perceptable improvement in speed. I think the improvement must be small, if it exists. Anybody claiming to report “The Truth About the Firefox Pipelining Trick” must state how much faster downloads are with the pipelining enabled and this report doesn’t do so. For the man to crow “I love this feature, and use it to it’s fullest” without quantifying what difference it makes, sounds like snake oil salesmanship to me.

  12. Thanks for the comment parviziyi. The problem with Pipelining is that it’s so dependent on so many factors, some people see a big difference, and some see nothing.

    Personally, the difference I’ve seen was minimal, but there none-the-less.

    Of course, there is also the possibility of the placebo effect on a lot of people as well, and that’s fine too.

  13. It only improves speed noticeably in certain situations. If you have to download many small files from a website (and it supports pipelining for that server), it will improve the speed drastically. After I enabled pipelining loading pages of thumbnails in MySpace or DeviantArt was shockingly faster.

  14. I enabled pipelining a while back.
    Over time I noticed that some graphics sites, with thumbnails, weren’t loading properly – – many thumbnails wouldn’t load, unless I refreshed a couple of times.
    If I switched to IE, everything would load normally.
    So, one day the light bulb went off, and I disabled pipelining. And voila, all thumbnails now load normally.
    I’ve tried adjusting the number, even down to 2, but some thumbnails still wouldn’t load.
    I don’t know why this happens, but now I have pipelining disabled… and all’s well.

  15. Seems a little bit faster. I am using FF 3, didn’t notice a great difference yet, but may I will see it soon. Keep on testing it.

  16. I am setting my pipeline value to 60. Will that possibly further enhance the browser speed on Firefox 3?

  17. I don’t know what all the hype is about, but I tried FF3 on my computer and it’s not as fast as expected. When I recently upgraded Internet Explorer 7 to IE7 PRO (you could call it Internet Explorer 7.5), it now loads pages as fast as FF3, has many of the FF features, and downloads faster. I am now enjoying IE7 PRO better than FF3.

  18. Wow luckly i read your article because the nglayout.initialpaint.delay that i had set to 0 was slowing down the websites from full load. I booted that and its super fast. Thanks

  19. O god… I am so sick of people all over the internet writing articles, and making videos tutorials with incorrect info about the network.http.pipelining.maxrequests hack…

    12 year old who knows nothing about computers writes: “Hey…What if i set it to a high number like 100?

    Idiot who copied and pasted the tutorial from another idiot writes: Wow IDK, i should try that, It would be super fast!

    12 year old writes back: I am such 1337 hacker.

    I so happy to finally get this info from someone who knows what they are talking about… Thanks

  20. I just tried this using Google image searches. Without pipelining, the pages loaded in an average of about 2.75 seconds. With pipelining, the average was about 2.25 seconds. Subjectively, the delay before the first image loaded seemed about the same, but the delay between the first image loaded and all images were loaded seemed much shorter.

  21. I changed as you directed and websites are loading much more faster than normal

    Thanks for this article i will add it to my blog once its ready

  22. @jon, and whoever has the same problem: You probably have a high-bandwidth application open at the same time (P2P or several HTTP downloads or whatever). Disabling network.http.keep-alive does the trick. It seems that a packet missing due to TCP throttling may block a connection, and with pipelining that means that up to 8 requests will not be resent until the connection times out.

    Also, keep in mind that the speedup by pipelining is roughly proportional to bandwith * latency

Comments are closed.