Canonical design team: "Download Day" of ubuntu.com"

Source: Internet
Author: User
Tags drupal
On the release day of the new version, we are ready to try out new Ubuntu's friends. From them, we can get up to 8000 download requests/second! In fact, on the day of the release of ubuntu13.10 on July 10, the official website of ubuntu.com maintained a good status and did not crash during many download peaks for a long time, thanks to the great efforts & ldquo; infrastructure Team & rdquo ;. Ubuntu.com has been running on Drupal (Official Website). Now we have moved it

On the release day of the new version, we are ready to try out new Ubuntu's friends. From them, we can get up to 8000 download requests/second! In fact, on the day of the release of ubuntu13.10 on July 10, the official website of ubuntu.com maintained a good status without crashing during many download peaks for a long time, this is due to the "infrastructure team" that has made great efforts ".


Ubuntu.com has been running on Drupal (Official Website). Now we have gradually moved it to more custom Django basic systems. In March this year, to release Trusty Tahr, we promptly started migrating the key # download part # Of the website. This has become an excellent opportunity to find ways to reduce server pressure!


Selecting a suitable image download source (geolocated) is a tough task for website applications.
When someone requests to download ubuntu from the ubuntu.com page (on a thank-you page), in fact, ubuntu.com sends around 300 image addresses closest to it.
In order to select a suitable image download source for users, it has to do the following:

1. Determine the country in which the client IP address is displayed.
2. Obtain the list of available image sources in the country
3. Randomly match the image source that can be downloaded with high bandwidth

This process is the most intensive work on the entire website, but it is not because these tasks are especially complicated, but because they need to be used for every 8000 times/second of potential users, during intense downloads, it is necessary to prevent the website from crashing due to high-intensity requests!
To effectively cope with the load on the website, we need to use more than 40 virtual machines to balance the load.
Can the client do anything?
The first thing we need to do is to load the complete image list to the "Thank you download page" and call JS in the user's browser to select the appropriate image! This will greatly reduce the load pressure on website applications, because the download page will be effectively cached like other pages!
In order to obtain the geographical location of users reliably, the only way is to use the geographic location API through the client. This function is supported by 85% of user browsers! Another small problem is that only the user gives a download request permission can get an allocated image to download. Zhejiang may slightly affect their experience!
This solution is a little inconvenient for users, so we found the new "trade-off ":
Integrated solution-"Apache geolocation"
Apache mod_geoip2 can apply server rules based on user locations, which is much faster than geographic positioning at the website application layer! This means that we can use Apache to send Users download pages for specific countries (such as the German download page), and add & country = GB after the URL!
These specific download pages contain the list of available download image sources in the country where they are located. Now none of them can be cached locally, which greatly reduces the pressure on the server. The client randomly selects the image to the user through JS (so that the download source of each image should be the most appropriate), and then starts the download, but the geographic location of the client is not required here!


I'm glad that this solution was successfully implemented before the release of Trusty Tahr!
-- (This article is also published in robinwinslow. co. uk)

Ubuntu 14.04Download, install, configure related knowledge http://www.linuxidc.com/Linux/2014-04/100370.htm

Ubuntu 14.04: Http://www.linuxidc.com/Linux/2014-04/100352.htm

Ubuntu 14.04 text tutorial on hard drive installation in Windows 7Http://www.linuxidc.com/Linux/2014-04/100369.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-08/106002.htm

Related Article

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.