Max parallel http connections in a browser?

I am creating some suspended connections to an http server (comet, reverse ajax, etc). It works ok, but I see the browser only allows two suspended connections to a given domain simultaneously. So if a user is looking at my web app in Tab1 of their browser, then also tries loading it in Tab2, they've used up the two allowed connections to my site.

I think I can do some wildcard domain thing, where I have my http server resolve any address to my site like:

*.mysite.com/webapp  -> 123.456.789.1 (the actual ip of my server)

so:

a.mysite.com/webapp
b.mysite.com/webapp
c.mysite.com/webapp

all still point to (www.mysite.com/webapp) but the browser considers them different domains, so I don't run into the 2 connection limit. Is this true?

Even if that is true - is there any limit to the number of active connections per browser, across all domains? Say I use the scheme above - does firefox for example only allow 24 parallel connections at any given time? Something like:

1) a.mysite.com/webapp
2) www.download.com/hugefile.zip
3) b.mysite.com/webapp
4) c.mysite.com/webapp
...
24) x.mysite.com/webapp
25) // Error - all 24 possible connections currently in use!

I just picked 24 connections/firefox as an example.


Max Number of default simultaneous persistent connections per server/proxy:

Firefox 2:  2
Firefox 3+: 6
Opera 9.26: 4
Opera 12:   6
Safari 3:   4
Safari 5:   6
IE 7:       2
IE 8:       6
IE 10:      8
Chrome:     6

The limit is per-server/proxy, so your wildcard scheme will work.

FYI: this is specifically related to HTTP 1.1; other protocols have separate concerns and limitations (ie, SPDY, TLS, HTTP 2).


HTTP/1.1

IE 6 and 7:      2
IE 8:            6
IE 9:            6
IE 10:           8
IE 11:           8
Firefox 2:       2
Firefox 3:       6
Firefox 4 to 46: 6
Opera 9.63:      4
Opera 10:        8
Opera 11 and 12: 6
Chrome 1 and 2:  6
Chrome 3:        4
Chrome 4 to 23:  6
Safari 3 and 4:  4

source: http://p2p.wrox.com/book-professional-website-performance-optimizing-front-end-back-end-705/

HTTP/2(SPDY)

Multiplexed support(one single TCP connection for all requests)

BrowserVersion | ConnectionsPerHostname | MaxConnections

  • Chrome34/32 6 10
  • IE9 6 35
  • IE10 8 17
  • IE11 13 17
  • Firefox27/26 6 17
  • Safari7.0.1 6 17
  • Android4 6 17
  • ChromeMobile18 6 16
  • IE Mobile9 6 60
  • The first value is ConnectionsPerHostname and the second value is MaxConnections .

    Source: http://www.browserscope.org/?category=network&v=top

    Note: ConnectionsPerHostname is the maximum number of concurrent http requests that browsers will make to the same domain. To increase the number of concurrent connections, one can host resources (eg images) in different domains. However, you cannot exceed MaxConnections , the maximum number of connections a browser will open in total - across all domains.

    链接地址: http://www.djcxy.com/p/88926.html

    上一篇: 为什么Tabindex不能使用Firefox?

    下一篇: 浏览器中最大并行http连接数?