12306 and collapse, buy a ticket how is it so hard

 

A month is the Spring Festival, and bought a ticket to go home reunion, China is our greatest wish, therefore 12306 also ushered in the peak tickets. The railway sector is expected, 2020 Nian 1 Yue 22 day ( twenty-eight ) , 1 Yue 23 day ( twelfth lunar month 29 ) as the peak travel period, ticket purchase May 12 Yue 24- day and 25 May will usher grab ticket peak. According to the spring of this year the number of Hu statistical point of view, 2020 the number of annual Spring Festival travel is estimated at 30 or so billion.

years

railway

highway

waterway

aviation

 

2011

2.3 Yi

26.4 Yi

3260

4000 Wan estimate

30 Yi

2012

2.35 Yi

28.47

3488 Wan

4245.1 Wan

31 Yi

2013

2.40 Yi

31 Yi

3810 Wan

4250 Wan

34 Yi

2014

2.66 Yi

32.8 Yi

4200 Wan estimate

4344.8 Wan

36 Yi

2015

2.95 Yi

24.22 Yi

4914 Wan

4284 Wan

28.09 Yi

2016

3.25 Yi

24.95 Yi

5140 Wan

4260 Wan

29.1 Yi

2017

3.57 Yi

25.21 Yi

5854.8 Wan

4397.6

29.81 Yi

Although the effects of income and other emerging car carpool mode, the total number of the spring in a downward trend, but the number of passengers or the railway has increased steadily, the number of railway ride this year is estimated to be home to visit relatives in the 4 or so million.

http://chinabaogao.com/resource/images/201802/20180226142828oggp_m.png

 

But 12 Yue 23 the first day to the peak of rush tickets, 12306 and collapse, always appear trips fails to load at the time of the query ticket home.

 

12306 too hard

While Ali cloud after 12306 and cooperation has rarely seen the collapse phenomenon, the author of this history in particular "Flying Dragon, Wang Jian country who" has been introduced here no longer comes to high concurrency problems, we always think of when the system "Luhan published romance" did not withstood the microblogging after architectural improvements that the future can support eight concurrent stars derailed, however, in the "Zhao Liying Feng Shao Feng official declared marriage" event, or no shore. Generally, typical systems use distributed spike technique for allocating a local inventory of each service node, and then to reduce the overall inventory through the message queue and caching techniques, particularly as shown below.

 

However, 12306 and general store, social networking spike systems are very different, but also to solve distributed, caching, load balancing problem. There are two main effects the greatest impact:

1. distributed architecture not fully fit tickets: 2015 Spring Festival ticket sales have been more than 6 million, reaching 6.36 million / day, while in 2019 the January 4 date PV amounted to 131.06 billion page views, all-day tickets on sale 12.82 million. Although this amount compared to the amount of frivolous days of two-eleven billion is nothing, but because of the different train ticket and general merchandise, he is a sub-station sale, for example Beijing to Guangzhou, there are 24 stations, when I bought when it under a full ticket, will need all the range of tickets all the shelves, a total of 24! = 300. 12306 so difficult to stock distributed to each local server inventory, as far as I know only a part of the full fare to the local division, in fact, a section of the ticket or to the center, and how the range of tickets is also a reasonable distribution itself is a problem, but also affected by the ticketing section of leverage on sale volume of 12 million, 10 times the actual sales of general merchandise corresponding even more.

2. Query / singular lower ratio is too high: the current query transactions accounted for 12306 of more than 90%, although Ali relevant unpublished data, but I see from practical experience, "double-October" I will not again see the products or the parity, but nothing directly involved in the activities, so the inquiry should not be trading volume accounted for 90 percent. And frequent queries will increase the pressure of 12306.

 

12306 how to deal with

As mentioned above, the difficulty of 12306 do not crash really great, but I did not experience such a large project spike system, where the shaking gall to propose the following:

The booking becomes a predetermined way ticket: We know that spike design scene, its original purpose is electricity supplier in order to enhance user engagement, increase user inputs a marketing tool. The 12306 seems to be no need to use this approach to be sold, such as some emphasis given a predetermined path windows 5 minutes, then aggregate all the service node records the customer's order, first-served basis in accordance with the centralized processing, real-time order processing becomes batch order processing, this way I have been working in a bank which is an effective way of sustained-release system pressure-tested.


Recommended for programmers purchase program

Let programmers group really did not need to use any of the 12306 website booking, I also recommend here before about a blog "on Github open source tools to help you achieve the" Eleventh "desire to go home," mentioned tickets tools ( https://github.com/testerSunshine/12306 ), it can meet this goal. Of course, because these tools are all dependent on tensorflow automatically enter the verification code, so in order to have a quick step or faster graphics more appropriate. Because this software is entirely artificial way of clicking on little risk, it should be no problem as long as no large-scale use.

But it also found on Github and some software to do multi-threading, clustering functions to grab votes, because this use is likely to touch "data security management approach" as stipulated "no compromise network security by malicious crawlers" the provisions of this specification does not recommend the use of cluster spike of software buying train tickets.

 

 

Published 144 original articles · won praise 4183 · Views 650,000 +

Guess you like

Origin blog.csdn.net/BEYONDMA/article/details/103689222