Anatomy of Twitter "6" Traffic peaks and cloud computing
Source: Internet
Author: User
KeywordsCloud
"6" Flow peak and cloud computing
a 6-step message from publishing to being read and Twitter's business logic. On the surface it seems to be boring, but chew it carefully, and each step unfolds, there is a story.
American Rugby final, nicknamed the Super Bowl. Super Bowl in the United States, the equivalent of China's CCTV Spring Festival party. February 3, 2008, Sunday, the year Super Bowl held as scheduled. New York Giants (Giants), against the Boston Patriots (Patriots). This is two teams of equal strength, the final result is unpredictable. The game attracted nearly 100 million Americans to watch live television broadcasts.
for Twitter, predictably, Twitter traffic is bound to soar during the game. The fiercer the race, the higher the flow. What Twitter does not anticipate is how much traffic will rise, especially in peak periods.
according to [31] statistics, in the Super Bowl competition, the flow per minute compared with the average flow of the day, the average higher than 40%. In the most intense competition, more than 150%. With a week ago, January 27, 2008, a quiet Sunday of the same period of time, the flow of fluctuations from the average 10%, rose to 40%, the highest volatility from 35%, rose to more than 150%.
Figure 8. Twitter traffic during Super Bowl, Sunday, Modified 3, 2008 [31]. The Blue line represents the percentage of updates/minute during the Super Bowl normalized to the average number of updates per minute during the rest of the day, with spikes annotated-to-show what arranges. The Green line represents the traffic of a "regular" Sunday, 27, 2008.
This shows that Twitter traffic is very significant fluctuations. For Twitter, these devices are idle for most of their time, and are not economically available if they are purchasing enough equipment to withstand changes in traffic, especially the peak flow caused by major events. But without enough equipment, the Twitter system could collapse in the face of major events, with the result that users would lose.
What about
? The way is to change to buy for rent. The size of the device that Twitter purchases itself is limited to the amount of traffic pressure that is not critical. At the same time leasing cloud computing platform Company's equipment to cope with major events to the temporary peak flow. The advantage of leasing cloud computing is that computing resources are allocated in real time, and when demand is high, more computing resources are allocated automatically.
Twitter has leased Joyent's cloud computing platform until 2008. On the eve of the Super Bowl on February 3, 2008, Joyent promised Twitter that additional computing resources would be provided free of charge during the game to cope with the peak flow [32]. But the weird thing is that with less than 4 days left before the big game, Twitter suddenly stopped using Joyent's cloud computing platform on January 30 10 o'clock in the evening to turn to Netcraft [33,34].
Twitter abandoned joyent, cast Netcraft, the reason behind it is business entanglements, or worry about joyent service unreliable, is still a mystery.
change to buy for rent, coping with flood peak, this is a good idea. But how to use the rented computing resources is a big problem. Looking at [35], it's not hard to find that Twitter uses most of the leased computing resources to increase the Apache Web Server, and Apache is the most cutting-edge aspect of the entire Twitter system.
Why does Twitter rarely allocate leased computing resources to mongrel Rails server,memcached servers,varnish HTTP accelerators and other links? Before we answer this question, let's review the last chapter, "Data flow and control flow," from the 6 steps that Twitter has written to read.
the first 2 steps of the 6-step approach, each browser that visits Twitter has a long connection to the Web site. The aim is to push new text messages to his readers within 500ms if someone publishes a new text message. The problem is that when there is no update, each long connection occupies an Apache process, and the process is in an empty loop. Therefore, most of the Apache process, in the vast majority of time, is in the empty loop, thus taking up a lot of resources.
in fact, via the Apache Web servers traffic, which accounts for only 10%-20% of Twitter's total traffic, Apache occupies 50% of the resources [16] of Twitter's entire server cluster. So, from an outsider's point of view, Twitter is bound to oust Apache in the future. But at present, when Twitter allocates computing resources, it has to be a priority to ensure Apache needs.
was forced to do just one thing, and on the other, it showed that Twitter engineers were too confident about the rest of the system.
In the fourth chapter, "The need for isolation from the flood", we have used an analogy, "during the dinner rush, restaurants are often full." For new customers, the restaurant attendants are not shut out but let these customers wait in the lounge. For the Twitter system, Apache's role is the lounge. As long as the lounge is large enough to temporarily stabilize the user, in other words, is not to allow users to receive HTTP-503 error prompts.
stabilize the user, the next job is to provide services efficiently. Efficient service, reflected in the 6 steps of the Twitter business process in the 4 step. Why is Twitter so confident about these 4 steps?
[] Updating Twitter without service disruptions. (http://gojko.net/2009/03/16/qcon-london-2009-upgrading-twitter-without-service-disruptions/)
[] Giants and Patriots draws 97.5 technologists US audience to the Super Bowl. (http://www.reuters.com/article/topNews/idUSN0420266320080204)
[to] Twitter traffic during Super Bowl 2008. (http://blog.twitter.com/2008/02/highlights-from-superbowl-sunday.html)
[Joyent] provides Twitter free extra capacity during the Super Bowl 2008. (http://blog.twitter.com/2008/01/happy-happy-joyent.html)
[A] Twitter stopped using Joyent ' s cloud at 10PM, 30, 2008. (http://www.joyent.com/joyeurblog/2008/01/31/twitter-and-joyent-update/)
[Hasty] the divorce for Twitter and Joyent. (http://www.datacenterknowledge.com/archives/2008/01/31/hasty-divorce-for-twitter-joyent/)
[km] the usage of Netcraft by Twitter. (http://toolbar.netcraft.com/site_report?url=http://twitter.com)
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.