With the average web page made up of more than 50 objects (Krishnamurthy and Wills 2006), object overhead now dominates the latency of most web pages (Yuan 2005). Following the recommendation of the HTTP 1.1 specification, browsers typically default to two simultaneous threads per hostname. As the number of HTTP requests required by a web page increase from 3 to 23, the actual download time of objects as a percentage of total page download time drops from 50% to only 14% (see Figure 1).
As the number of objects per page increases above four, the overhead of waiting for available threads and describing the object chunks being sent dominates the total page load time (80% to 86% at 20 and 23+ objects respectively), compared to the actual object retrieval time due to file size. The description time plus the wait time caused by limited parallelism contribute from 50% to 86% of total page retrieval delay. Chi and Li also found that once the number of embedded objects exceeds ten, the description (or definition) time increases to over 80% of the total object retrieval time (Chi and Li 2002). Note that you can significantly reduce the overhead of multiple objects (for more than 12 objects per page) by turning on keep-alive and spreading the requests over multiple servers (Hopkins 2007). The HTTP 1.1 specification, circa 1999, recommends that browsers and servers limit parallel requests to the same hostname to two (Fielding et al. 1999). Written before broadband was widely adopted, this specification was designed for narrowband connections. Most browsers comply with the multithreading recommendation of the specification, although downgrading to HTTP 1.0 boosts parallel downloads to four. So most web browsers are effectively throttled by this limit on parallel downloads if the objects in the web page they download are hosted on one hostname. There are two ways around this limitation: You can, of course, set up multiple object or image-hosting servers to boost the number of parallel downloads. For example: Each of these subdomains does not have to be on a separate server, however. A more elegant solution is to set up multiple subdomains that point to the same server. This technique fools browsers into believing objects are being served from different hostnames, thereby allowing more than two-threads per server. For example you can set: within your DNS zone record. Now you can reference different objects using different hostnames, even though they are on the same server! For example: All of these URLs point back to: Two studies conducted by Yahoo! and Gomez demonstrate how increasing the number of hostnames can minimize parallel download delays. Steve Souders and Tenni Theurer of Yahoo! reported on a test in their Performance UI blog (Theurer and Souders 2007). Varying the number of hostnames, as well as object size, the Yahoo! engineers found that two hostnames gave the fastest response times for larger file sizes (see Figure 2). Theurer provided WSO with an updated figure showing the trends for response times versus the number of aliases and image file size. Ryan Breen of Gomez ran a test using a similar technique. He found a 40% improvement using three hostnames (see Figure 3). With the average web page growing past 50 external objects, minimizing object overhead is critical to optimize web performance. You can minimize the number of objects by using CSS sprites, combining objects to minimize HTTP requests, and suturing CSS or JavaScript files at the server. With today's faster broadband connections, boosting parallel downloads can realize up to a 40% improvement in web page latency. You can use two or three hostnames to serve objects from the same server to fool browsers into multithreading more objects.Parallel Download Default Throttles Browsers
Using Multiple Servers
images1.domain.com
images2.domain.com
images3.domain.comUsing Multiple Hostnames on the Same Server
images1.domain.com domain.com
images2.domain.com domain.com
images3.domain.com domain.com<img src="images1.domain.com/i/balloon.png" alt="balloon">
<img src="images2.domain.com/i/flag.png" alt="flag">
<img src="images3.domain.com/i/star.png" alt="star">domain.com/i/Optimum Number of Hostnames to Minimize Object Overhead

Figure 2: Median Response time versus Number of Aliases (used with permission)
Conclusion
Further Reading
By website optimization on 26 Dec 2007 AM
does it make a difference if you use third or fourth-level subdomain? For example, can you still gain parallel downloading benefits if you use the following structure:
www1.images.domainname.com
www2.images.domainname.com
www3.images.domainname.com
www4.images.domainname.com
By: dkbugger
on December 28, 2007 12:54 AM
would www.something.com and something.com be 2 different domains?
By: quantumrider
on January 4, 2008 8:52 AM
dkbugger,
hi, no i don't believe so. as long as the hostnames are different. so a sub-sub domain would work like a sub-domain.
By: website optimization
on January 7, 2008 10:06 AM
On most domains www. redirects (Rewrites) to the domain.com so www.domain.com shows the same content as domain.com. I would use something like www1.domain.com and www2.domain.com i have seen this done on some really high trafficked websites before and is what i think I'm going to do on mine, as my page is taking 37s to load on a 56k and that's just to long....
As I'm thinking about this a question comes to mind, is there anything that will just randomly pick 1 out of 2 or 3 sub-domains for each request? Link a server mod or something?
Email me if you know of anything that can do this.
David M.
By: David m. on October 29, 2008 1:35 AM
www.domain.com and domain.com are both valid hostnames - for most sites they serve the same content (as they should) www1.domain.com www2.domain.com www3.domain.com Are all valid "subdomains" aka hostnames -- these hosts can be configured to serve web traffic.
There is no difference if you add another level deep to the host name www1.images.domainname.com -- this too is a valid host name (or subdomain).
Q: Is there anything that will just randomly pick 1 out of 2 or 3 sub-domains for each request? Link a server mod or something?
A: Round robin DNS each pick a DNS entry for a single dns request So you would have 3 hosts -- (host1 host2 host3) all configured to server pages for www.domain.com In which case the DNS system returns one of 3 different IP addresses when asked for a response to resolve www.domain.com
The thing to remember here is a server (hardware device) will have a hostname - host1.domain.com
This host can be configured to serve pages for domain.com / www.domain.com Using Round robin DNS (poor man's load balancer) the request for pages from domain.com would be directed to host1 or host2 or host3 .....
By: Brad Glonka on October 29, 2008 11:59 AM
You can also save each request made in your database, including a timeframe, as in unix timestamps for visit time plus salt. This you must do for each server.
Then use your favorite scripting language, like php, to pick the server that is the least busy. Be sure to have some garbage collector in place for entries that pass the time limit.
It's not an ideal solution, since it just takes up server resources instead. But in some cases it might still be worth it.
Just be sure to avoid breaking your 304 not modified header, you should be able to do this using the Etag.
By: BlueBoden on June 29, 2009 12:53 AM
in case that images are uploaded by users how can I specify to upload to subdomain 1 ,2 or 3? The images are generated on homepage automatic
By: licitatii on September 28, 2009 10:12 AM
How do I set up multiple subdomains that point to the same server within my DNS zone record? Why not just leave the subdomains as they are, so that they point to domain.com/folder1, domain.com/folder2 and domain.com/folder3 ?
By: Xenon site admin on October 3, 2009 7:43 AM
so. www.domain.com and www2.domain.com will be two different domains. and to make www2.domain.com I have to make a subdomain named www2. So, in this case it's worth the optimization? Thank you!
By: licitatii on October 21, 2009 12:22 PM
How can I implement this in an environment that serves it's content from different domains like
product.company.com
product.company.co.uk
product.company.de
product.company.fr?
The URLs for included css, js and images are relative to those domains.
I could use 2 subdomains to server static contents which would work for e.g. all european derivates of the product with lets say static.company.de and .co.uk. But including images this way would also root the non-european derivates to get their content from the eu-cluster.
Any solutions for this?
Is there a way to rewrite all urls in a document before sending it to the client?
Thx for feedback.
By: TryItBut on December 2, 2009 1:48 AM