High-traffic web system optimization

Xu Lingbo/Junshan detail static
https://github.com/xulingbo/xulingbo.github.io/issues/Xu
Lingbo joined Taobao in 2009 and is currently in charge of product detail business and stability related work. The main optimization project of Taobao's high-traffic Web system, author of "In-depth Analysis of Java Web Technology Insider". Personal website http://xulingbo.net

Taobao big second system design detailed explanation
http://geek.csdn.net/news/detail/59847
Key points
Hotspot isolation: business isolation, system isolation, data isolation, this is when the second kill system is different from other It is only considered when the systems coexist. It seems that it is not necessary to simply discuss the seckill system, but the actual situation estimates that the members, commodities and discounts of the seckill are all from the ordinary system, so it is unrealistic to simply discuss the seckill system.

The separation of dynamic and static allows the browser and CDN to cache most of the static data, so that although the number of concurrent requests is still the same, the data in the request parameters and return values ​​is very small.
The seckill page provides a "refresh" button, allowing users to click the "refresh" button to enter the seckill start state from the seckill waiting state, without requiring the user to refresh the browser or press F5 to refresh the page, which further reduces the number of requests, and the user is in the seckill There are basically no requests for a large number of "static" data in the initial period of time. Peak shaving

based on time slicing
That is to say, the spike answer is added. Of course, a very important purpose of the spike answer is to prevent the spike. In fact, there is another important function of adding answering questions, which is to lengthen the peak order request, from the previous 1s to about 2~10s. The request peak is based on time sharding, and the sharding at this time is for the service. It is very important to process concurrency on the side, which will reduce a lot of pressure. In addition, due to the order of requests, the later requests are naturally out of stock (this is also because of the following data layered verification), and the final ordering step cannot be reached at all. , so the real concurrent writes are very limited.

Data hierarchical verification
Put a large amount of static data that does not need to be checked in the place closest to the user; check some basic information in the front-end reading system, such as whether the user is eligible for seckill, whether the product status is normal, whether the user answers the question correctly, whether the seckill is correct It is over, etc.; in the writing data system, check whether it is an illegal request, whether the marketing equivalents are sufficient (gold coins, etc.), and the consistency of the written data, such as checking whether the inventory is still there, etc. Finally, the database layer ensures the final accuracy of the data properties, such as inventory cannot be reduced to negative numbers.

Key technology optimization points
Java processing large concurrent dynamic request
optimization Large concurrent read problem of the same product Large
concurrent update problem of the same data




nginx
http://tengine.taobao.org/documentation_cn.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326644593&siteId=291194637