Web-High concurrency Solutions

Source: Internet
Author: User

Let's look at what concurrency and parallelism are

Concurrency: concurrency refers to two or more events that occur at the same time interval, that is, can overlap in the time period of the start, concurrency refers to a period of time a few programs are in the start run to run, and these programs are running on the same processor, but at any point in time only one program on the processing machine run.

Parallel: parallelism means that two or more events occur at the same time

Height ratio The parameters of the hair care

QPS (TPS): The number of request/transactions per second, in the Internet domain, the number of response requests per second (referred to as HTTP requests);

QPS = concurrency number/average response time

Throughput: The number of requests processed per unit of time (usually determined by the QPS and concurrency numbers);

Response time: The average time the system responds to a request. For example, the system processing an HTTP request requires 200ms, this 200ms is the response time of the system (I think this should only contain processing time, network transmission time ignored).

Scenario One: Separation

For the Web server, the picture consumption of resources is very large, large sites are basically using picture separation, they are independent, multiple image server, can reduce the system pressure on the server, the picture and the Web server can be configured to optimize, to ensure the efficiency of execution

Scenario Two: Using caching

The word cache has been touched by technology, and caches are used in many places. Caching in the Web site architecture and Web development is also very important. Here we first describe the two most basic caches. The advanced and distributed caches are described later. Architecture cache, people familiar with Apache can know that Apache provides its own cache module, can also use the addition of Squid module for caching, both of which can effectively improve the access response of Apache. Web application development cache, the memory cache provided on Linux is a common cache interface, can be used in web development, such as Java development can call MemoryCache to some data caching and communication sharing, some large communities use such a framework. In addition, in the use of web language development, all kinds of languages have their own cache modules and methods, PHP has pear cache module, Java more,. NET is not very familiar with, I believe there is certainly.

Scenario Three: HTML static

can use static pages, as far as possible to use static pages, some information published sites, interactive community, the use of static is necessary, HTML static is also the use of certain caching strategies, for the system frequently using database queries but the content of small updates, you can consider using HTML static to achieve. For example, forums in the Forum's public settings information, the current mainstream forum can be managed backstage and stored in the database, which is actually a large number of reception program calls, but the update frequency is very small, you can consider this part of the background update the time to static, so as to avoid a large number of database access requests.

Scenario Four: DB cluster

Large Web site structure is very complex, access to a large number of users, a database is easy to reach the bottleneck, in the database cluster, many databases have their own solutions, Oracle, Sybase and so have a very good solution, commonly used MySQL provides master/slave is similar to the scheme, What kind of db you are using, refer to the corresponding solution to implement it.

Scenario Five: CDN Acceleration Technology:

The full name of the CDN is the content distribution network. The goal is to add a new layer of network architecture to the existing Internet, publish the content of the site to the "Edge" of the network closest to the user, so that users can get the content they need and improve the responsiveness of users to the site. A CDN is different from mirroring because it is smarter than mirroring, or it can be used as a metaphor: cdn= more intelligent mirror + cache + traffic diversion. Therefore, CDN can obviously improve the efficiency of information flow in Internet network. From the technical comprehensive solution due to network bandwidth is small, user access is large, dot distribution is not equal problem, improve the response speed of users to visit the site. CDN Type features the implementation of CDN is divided into three categories: mirroring, caching, and leased line. Mirror sites (Mirror site), which are the most common, allow content to be published directly for static and quasi-Dynamic Data synchronization. However, the cost of purchasing and maintaining a new server is high, and a mirror server must be set up in each region with professional technicians for management and maintenance. For large web sites, the bandwidth cost of updating is also greatly increased. Cache, low cost, suitable for static content. Internet statistics show that more than 80% of users often visit the content of 20% of the site, under this rule, the cache server can handle the majority of the customer's static requests, and the original server only need to process about 20% non-cached requests and dynamic requests, thus greatly speeding up the response time of the customer request and reduces the load on the original server. CDN Services typically place cache servers on key nodes across the country. Dedicated line, allowing users to directly access the data source, you can achieve dynamic synchronization of data.

Web-High concurrency Solutions

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.