How does Twitter rapidly deploy code on thousands of servers?

Source: Internet
Author: User
Tags version control system website performance

The answer is: use BT, which is the BitTorrent you should be familiar.

For website operators and entrepreneurs, the scalability problem is inevitable during the growth of website traffic. How to Establish a scalable architecture) it is an indispensable professional knowledge in the planning of the website business process.

How can we evaluate and analyze the website performance bottleneck when the functionality of the service meets user needs and the service growth becomes bottleneck due to architecture, program performance, and database performance problems? After clarifying the problem, how to find the corresponding solution may include:

  • How can we effectively clarify the problem? Data (read time) from the client, log logs from the server, and Hardware load rate?
  • What is the bottleneck of website performance on the client or server? Is the database unable to support or is the program performance poor? Is there too much request or too much data?
  • How can web server and DB Server squeeze out more resources? How can I scale out a resource that cannot be squeezed out? What problems will happen after expansion?

It is a good way to refer to the architecture practices of well-known foreign websites. Although the Service scale may not be comparable, the first step is taken based on the "correct practices and experience, it must be a breakthrough in website operation performance bottlenecks.

As the world's largest Weibo service, Twitter uses thousands of servers to provide services to users from all over the world. However, whenever the website content and applications are updated, how to deploy program code to all servers in the shortest possible time is quite important.

An article on Twitter's blog: "Murder: Fast datacenter code deploys using BitTorrent" (not accessible directly) shares how Twitter continues to improve the application deployment process, in the past, Twitter used Capistrano to deploy applications. Capistrano is an open-source project for many Ruby/rails users (of course developers in other languages will also use it) to deploy program code, in the process of deploying program code, developers can simplify repetitive work through automated deployment processes, especially when the project must be deployed on multiple application servers at the same time.

In the early days, Twitter relied on Capistrano to deploy applications. Whenever a new version of the program code needs to be released, capistrano will update all the Twitter Servers Based on the preset settings and procedures. In the past, there were not many servers, and everything was wonderful, however, as the number of Twitter servers increases, when we reach hundreds of servers, things are no longer as good as they used to be, or even when we have thousands of servers, the update operation takes 40 minutes.

To address this problem, Twitter believes that the key to the problem is to use a centralized system, that is, all servers should queue in turn to the same version control system for code updates. Twitter initially thought that the version control system was also deployed in a distributed architecture. server code updates can be distributed to different machines to reduce the deployment time, but in fact, even if the version control system is distributed across multiple servers, it takes the same time for these servers to update files. Therefore, Twitter may need a completely decentralized solution, preferably BitTorrent. using P2P features, all nodes can help update program code.

According to the resultsBitTorrent is used to update code. The deployment time is greatly reduced from 40 minutes to 12 seconds!This is an amazing improvement. The Code Update for thousands of servers can be completed in just 12 seconds.

Twitter also shared the results of this deployment process improvement. The project name is murder. If you are interested in technical details, you can perform further research; the author briefly excerpted several key points as follows:

  • Murder is developed based on bittornado (bittornado is a BitTorrent client ).
  • Murder is positioned to "help us quickly deploy files to a large number of servers 」.
  • Using BitTorrent deployment can avoid firewall problems and achieve extremely fast transmission speeds.
  • The actual deployment code works with Capistrano, which is clearly described on the webpage.

The following is a video of Twitter's architecture engineer Larry gadea talking about murder (not accessible directly ):

Twitter-murder BitTorrent deploy system from Larry gadea on Vimeo.

Original article title: How Twitter can quickly deploy programs on thousands of servers

Link: http://www.inside.com.tw/07/17/how-twitter-deploys-application-to-thousands-of-servers

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.