Forum Moderators: phranque

Message Too Old, No Replies

HTTP/1.1 persistent connection

         

Discovery

10:24 am on Jan 21, 2008 (gmt 0)

10+ Year Member



I read that
Internet Explorer typically establishs 2 persistent connections to each Web server.

here my question is that,

For eg,
I am hosting 3 website abc.com, pqr.com & xyz.com on same web server (ie, on one physical server with one IP), Is it like that there should be establishes 2 persistent for all these site, because for all 3 site there is 1 web server or its for each domain there 2 persistent connection.

Thanks

gergoe

1:07 pm on Jan 21, 2008 (gmt 0)

10+ Year Member



HTTP connections are not persistent. What this sentence says that if you go on to a website with Internet Explorer (and you have 100 images for example), then Internet Explorer will open at maximum two connections to that webserver to download each image. They can be referred as persistent connections because HTTP 1.1 specification allows reusing of connections through a keep-alive mechanism, so the browser does not need to open a new socket connection for each resource, but can reuse one of the earlier opened ones, after that has been finished.

So what it means is, if you go to a webpage which has no images or any other external references, one connection will be opened (to fetch the html file), and after the timeout of keepalive elapses - which is typically around 10-15 seconds - then the connection will be closed. This a setting on the webserver, you can choose to disable keepalive, or change its parameters (make the grace perion shorter/longer, etc.)

I'd don't know the interiors of browsers that much that I can tell you for sure what does the browser consider to be the same server or not, but in my experience it is the hostname, so if you have three websites on the same server (therefore ip address), then the browser will open at maximum 6 connections (two for each website).

It is worth to mention, that this 2 connection per website limitation is something you can change in the browser (in the case of Internet Explorer see this link [support.microsoft.com], in Firefox look for the

network.http.max-persistent-connections-per-server
preference setting).

Discovery

2:02 pm on Jan 21, 2008 (gmt 0)

10+ Year Member



Thanks gergoe, for this valuable information, now my concern is that,

I'd don't know the interiors of browsers that much that I can tell you for sure what does the browser consider to be the same server or not, but in my experience it is the hostname, so if you have three websites on the same server (therefore ip address), then the browser will open at maximum 6 connections (two for each website).

Can you please clear this or anyone here to support this.

Thank again gergoe :)