views:

5559

answers:

6

In Firefox 3, the answer is 6 per domain: as soon as a 7th XmlHttpRequest (on any tab) to the same domain is fired, it is queued until one of the other 6 finish.

What are the numbers for the other major browsers?

==== Update: ====

Here's the list so far -- please help complete it!

Number of concurrent requests of any type (including AJAX, image loads, etc) to a single domain:

  • FF 2: 2
  • FF 3: 6
  • IE 6/7: 2
  • IE 8: 2 on dialup, 6 on broadband
  • Safari: ?
  • Chrome: ?

===============

Also, are there ways around these limits without having my users modify their browser settings? For example, are there limits to the number of jsonp requests (which use script tag injection rather than an XmlHttpRequest object)?

Background: My users can make XmlHttpRequests from a web page to the server, asking the server to run ssh commands on remote hosts. If the remote hosts are down, the ssh command takes a few minutes to fail, eventually preventing my users from performing any further commands.

+7  A: 

One trick you can use to increase the number of concurrent conncetions is to host your images from a different sub domain. These will be treated as seperate requests, each domain is what will be limited to the concurrent maximum.

IE6, IE7 - Have a limit of two. IE8 is 6 if your a broadband, 2 if you are dial up.

Bob
Thanks, Bob. So are you saying that FF actually limits *all* requests to 6, not just AJAX requests?
Michael Gundlach
No, the limits are imposed on the domain. So you could technically get FF up to 12 connections if you had a subdomain in addition to your site.
Bob
Just to clarify, the browser does the limiting (server can technically have its own) based on the name of the domain.
Bob
So if I understand you, FF limits *all* requests (to a single domain) to 6 -- not just XmlHttpRequests to a single domain. And other browsers do the same thing with different limits. Correct?
Michael Gundlach
Ohh yes, If you have a page with a thousand images, it will download them in groups of six. I believe most other mainstream browsers work the same way.
Bob
A: 

I believe there is a maximum number of concurrent http requests that browsers will make to the same domain, which is in the order of 4-8 requests depending on the user's settings and browser.

You could set up your requests to go to different domains, which may or may not be feasible. The Yahoo guys did a lot of research in this area, which you can read about (here). Remember that every new domain you add also requires a DNS lookup. The YSlow guys recommend between 2 and 4 domains to achieve a good compromise between parallel requests and DNS lookups, although this is focusing on the page's loading time, not subsequent AJAX requests.

Can I ask why you want to make so many requests? There is good reasons for the browsers limiting the number of requests to the same domain. You will be better off bundling requests if possible.

cbp
My XmlHttpRequests cannot go to different domains as you suggest, due to the Same Origin Policy. (Perhaps this is an argument for using jsonp to get around this problem.)This page is a command-and-control dashboard for many computers; thus a request is spawned per execution requested by the user.
Michael Gundlach
+1  A: 

With IE6 / IE7 one can tweak the number of concurrent requests in the registry. Here's how to set it to four each.

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"MaxConnectionsPerServer"=dword:00000004
"MaxConnectionsPer1_0Server"=dword:00000004
brianegge
A: 

If I host external javascript on a subdomain, will cross-site scripting defense affect its usability?

roger
This is a question, not an answer.
Angelo Genovese
+2  A: 

The network results at Browserscope will give you both Connections per Hostname and Max Connections for popular browsers. The data is gathered by running tests on users "in the wild," so it will stay up to date.

Kevin Hakanson
A: 

how many concurrent requests are allowed in IE9 ?

Irina