14 Rules for building high-performance Web sites: Using CDN

Source: Internet
Author: User
Tags free cdn akamai technologies

The distance between the user and the Web server can also affect the response time. From a user's perspective, deploying content to multiple, geographically dispersed servers can also help speed up the loading of web pages. But where should we start?

The first step in geographically distracting content is not to redesign the Web application for the purpose of running on a distributed schema. Depending on the complexity of the application, changes to the schema can involve significant difficulties, such as synchronizing session state and replicating database transactions among multiple servers. Because of the architectural issues involved, attempts to shorten the distance between users and content in this way can be delayed or even never approved.

Don't forget that the end user response time 80~90% are all spent on components on the download page: Images, stylesheets, scripts, Flash, and so on. Also, this is the "Performance Golden Law" that we emphasize in the "importance of foreground Performance" section. Therefore, it is entirely possible to avoid the challenge of redesigning the application architecture and focus on decentralized static content. While this does not result in significant time savings, it is easy to implement with the help of content distribution networks.

The so-called Content distribution network (Delivery NETWORD,CDN) is a collection of Web servers in which servers are distributed in different locations to distribute content more efficiently to users. A server that is ultimately determined to distribute content to users is usually based on measurements of the proximity of the network. For example, a server requires a minimum hop for the user, or the server has the shortest response time to the user.

Some large internet companies have their own CDN. However, products that use CND server providers are often more cost-effective. Common CND services include: Akamai Technologies, Mirror Image Internet and Limelight Networks. For startups or personal sites, it's usually not necessary to consider using CND. However, as the target user base grows and becomes more and more globalized, CDN's role in accelerating response time is becoming more and more prominent. In Yahoo!, it is possible to save more than 20% of the response time for end users by separating the static content from the application and transferring it to the CDN. Transferring static content to a CDN requires less code changes, but it can get a dramatic boost to the site's speed.

--------------------------------------------------------------------------------------------------------------- --------------------

The user's network bandwidth is increasing every year, but the speed with which the user accesses your Web server is still limited by the region (John: The most typical example is the north-South Telecom interoperability problem in our continent). Web entrepreneurs tend to place their servers in a certain area of the computer room, but once they get through the tough start-up phase and start to face the influx of users, they have to face the reality that a server in a regional room is not enough to handle such a big visit, It is time to deploy more content servers on multiple decentralized geographies (urban nodes).

How to take the first step. To implement geographic content distribution, don't rush to try to redesign your Web application with a distributed system architecture. If you depend on the distribution of the application system, your refactoring work can be daunting, such as dealing with complex issues such as synchronization of session state and processing of data consistency between databases across multiple geographies (John: If you're working with a bank-level user application, this is not discussed here). You should give priority to shortening the geographic distance between users and your Web content.

Remember the golden rule of performance we discussed in the previous chapter A:
Only 10-20% end-user response time is spent on downloading HTML source files. Other 80-90% are spent on all the components in the download page.
  
If your Web application server is close enough to the user, the response time for the first HTTP request discussed in Chapter A can be faster, or if your Web Component server is close enough to the user, the response time to request these components in the page is shortened, This is much smaller than the complexity of redesigning a distributed system, which requires a content distribution network: CDN (Delivery Networks).

Content Delivery Networks

Content distribution Network CDN is a cluster of network servers distributed across multiple geographies to provide users with more efficient content access services. This efficiency is reflected not only in performance, but also in cost savings, as CDN chooses a server that is closest to the physical node of the requesting user to provide content access services to the user to improve response time.

Some large internet companies have their own CDN, but the use of professional CDN service providers is more cost-effective. Akamai technology, for example, acquired the Speedera Network company in 2005 and became a leader in the North American CDN Market, as well as mirror image network company, Limelight Network Company, SAVVIS company and so on.

The following figure 2-1 is the top ten U.S. websites using CDN:


We can see:
• Five sites using Akamai
• There are three selected Mirror Image,limelight,savvis, respectively.
• The other five are either not using CDN or have their own CDN solutions

Small or non-commercial websites may not be able to afford the high cost of CDN servers, but there are some free CDN services to choose from. such as Globule (http://www.globule.org) based on the Apache module deployed at the Free University of Amsterdam, Codeen (http://codeen.cs.princeton.edu) at Princeton University and so on. (John: To be honest, these free CDN are of little use to us.)
There is a benefit to CDN in addition to improving response time. CDN can also be used to back up data, extended storage capacity even for caching, it can also help us solve the problem of peak traffic, such as a strong real-time weather forecast or financial news services, or the release of some sports entertainment news, this instantaneous access to high traffic can also be diverted by CDN.

Speaking of which, it's time to talk about the drawbacks of CDN, in addition to the high cost, your service response time depends on the hardware of the CDN service provider and on other sites that use the CDN at the same time, and may even be affected by your competitors if your competitor is using the same CDN service provider as you. Because CDN service providers typically share these resources among all of his distributors (John: This is a good reason to use a shared virtual host in the computer room). Another disadvantage of CDN is that you may not be able to control these content servers directly, if you want to modify the HTTP response headers for all components in the CDN, this may have to go through the CDN service provider rather than your own technician. If the CDN itself is out of the question, it will directly affect the user's access to your web. In Figure 2-1, ebay and MySpace use two CDN service providers, which is a smart move to reduce risk if you have enough business needs and money to support you.

A CDN is used to distribute static content, such as pictures, scripts, stylesheets, or Flash. To provide a Dynamic HTML page requires a certain server-side requirements: Database connectivity, state management, authority authentication, hardware and operating system optimization, and so on, these complex things are beyond the CDN server scope (JOHN:CND is not a virtual host provider). Because CDN only provides static file access, on the other hand, it makes it more targeted, and it only focuses on the use of Web sites that provide more static files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.