How to solve the problem of performance degradation caused by large-scale concurrent access of web site

Source: Internet
Author: User
Keywords Web site Access Optimization
Tags 12306 websites access application application server based booking booking tickets caching

Absrtact: Another half month in 2013, the Spring Festival is coming, every year the people who work overseas will be worried about booking tickets. In particular, online booking, 12306 to provide the online booking system will have a variety of views, from last year's Spring festival, the Ministry of Railways launched 12306 websites,

The 2013 Spring Festival is coming in half a month, and every year people who work overseas will be bothered by booking tickets. In particular, online booking, 12306 to provide the online booking system will have a variety of views, from last year's Spring festival, the Ministry of Railways launched 12306 websites, the implementation of the network real-name purchase tickets, each returned to the original thought can buy a ticket home, but the result is still disappointed. In the last year, 7 days, 12306 Web site users have accounted for 0.902% of the world's internet users, a daily hit of up to 1 billion people, the system was unable to support such a large amount of traffic and fell into a crash. 12306 site clicks belong to tens of millions of PV level, if you want to meet the actual requirements, then need to be able to deal with large-scale concurrent access to the site, this problem, many large web site webmaster may also face. To solve the problem of the performance of large-scale concurrent access to the site, there are many common methods, we can from the following levels to consider and optimize?

Server Configuration Optimization

We need to plan the number of application servers based on the performance of the application server and the size of concurrent traffic. There is a use of the principle is: a single application server performance does not necessarily require the best, but the number must be sufficient, it is best to have a certain amount of redundancy to ensure server failure. In particular, the number of servers in some critical applications is appropriately increased during high concurrent access peaks. For example, in some peak query business, you can use more than one server to meet the user's million clicks per hour.

Second, the use of load balancing technology

Load balancing technology is the core technology to solve the centralized concurrent access, and it is also a more effective method to solve the large-scale concurrent access of the website. The main equipment to realize load balancing technology is load balancer server. For example, we deploy a Web site to two different servers (provided that the 2 or more servers are properly running the Web site program), which is load balanced between these servers by installing specific software. Then, at some point, when the site is faced with large-scale access, the user's request will be through the load balancing program, according to the busy and resources of different servers, automatically assigned to the best processing performance of the server, so that large-scale user generated high concurrent access to the various servers evenly. This can greatly reduce the single server to handle high concurrent requests, to ensure that the entire Web site system faced with high load reliability.

III. Database Structure Design

This is part of the problem with the program layer, which is usually the responsibility of the software engineer to optimize the SQL statements. The measures we can take include: Indexing database fields that are frequently queried, partitioning database tables (such as partitioning large amounts of data, such as partitioning data by year),-sql database query statements (reducing redundant database operations, and Improve query efficiency) for optimization.

Iv. Optimization of middleware

The so-called middleware, it will sound a bit like a very deep technology, in fact, in our side, you webmaster friends often used in the site deployment of Apache, IIS, Tomcat, WebLogic are middleware. Middleware is mainly located on the client/server operating system, responsible for the computer resource management and network communication. As a simple example, when we deploy Java projects, we typically use Tomcat middleware, and Tomcat is not optimized by default, and is very easy to do when it is high concurrency. About the optimization of Tomcat gives the following suggestions (I am in the actual project development process feel more important points): ① thread pool optimization, ② boot memory optimization, ③ log output optimization, ④http compression optimization, ⑤ profile optimization.

The above example of the Tomcat middleware (that is, the Web server) is just an example, different sites using different architectures, then the corresponding middleware optimization will also have different methods, such as Microsoft's IIS has the corresponding configuration parameters, so the specific optimization method can be based on the needs of the project, Consult the official documentation of the middleware to set the parameters so that the optimal setting of the middleware can be realized.

V. the use of data caching technology

Now most large web sites have the use of caching technology, users often use the data through the cache technology management, thereby reducing the pressure of the server to request, improve the speed of the site access. There are a lot of cache technology, I personally based on the actual project experience, you can divide it into 2 kinds, namely, data caching and page caching.

① is called data caching, which means that the data in the database is not transmitted directly, but rather that the data is called into memory and then read from memory, which can greatly improve the reading speed. There are many scenarios for data caching technology, because of the features of open source and high performance, we recommend using Memcache to set up data caching technology to speed up dynamic Web applications and reduce database load.

② page caching is partly for public pages, static is also a kind of page caching, the user frequently visited the page in the server's corresponding directory to generate static pages, when the user again access, do not need to make dynamic requests to the server, but only to the cached HTML page directly read, The efficiency of such visits can be effectively improved.

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.