Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of high concurrency such as CDN

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you how to solve CDN and other high concurrency problems, the content is very detailed, interested friends can refer to, hope to be helpful to you.

(1) Cluster and distribution

Both clustering and distribution are processed using multiple servers. Each server in the cluster has the same function, which server can be called when processing the request, which mainly plays the role of diversion. Distribution is to put different services into different servers, and multiple servers may be used to process a request, which can improve the processing speed of a request. There are two ways to cluster: static resource clusters and application clusters. Static resource clustering is relatively simple, while application clusters need to synchronize some of the data that may be cached across all servers in the cluster, such as session. There are two ways to synchronize session, one is to actively synchronize to other servers after a change in session, such as tomcat, and the other is to use a common program to manage session, such as memcache, redis and so on. The essence of session synchronization is to allow different servers to process the requests of the same user, so in load balancing, if the requests of the same user can be assigned to the same server, then session is not needed. In order to prevent data loss after machine downtime, you can also group the servers in the cluster and synchronize session within a small range of groups. Another core problem for the cluster is load balancing, that is, which server is assigned to handle a request after receiving it, which can be handled by software or by using special hardware (such as F5).

(2) Separation of applications and static resources

At the beginning, applications and static resources are saved together. When the concurrency reaches a certain degree, static resources need to be saved to a special server. Static resources mainly include pictures, videos, js, css and some resource files. They have no state and are easy to separate, so you can store them directly to the corresponding server. Access through a special domain name.

(3) Page caching

Page caching caches the pages generated by the application so that there is no need to regenerate the page every time, thus reducing access requests to the application server. Nginx server comes with page caching function.

(4) CDN

CDN is a special cluster page cache server, which is different from the ordinary page cache server in the way it stores and allocates requests. CDN servers are distributed in various regions of the country, and the most appropriate CDN server will be selected for users' requests. For example, Unicom users' requests will be assigned to Unicom's CDN server node, and Shanghai users' requests will be assigned to Shanghai CDN server nodes to handle. Each CDN node is a page cache server, and resources that are not cached will be fetched from the master server, otherwise they will be returned directly. CDN allocates requests in a special way, not through an ordinary load balancing server, but by using a special CDN domain name resolution server. CNAME resolves the domain name to a special domain name, then resolves the special domain name through the CDN domain name resolution server and assigns it to a CDN server node.

(5) reverse agency

Reverse proxy means that the server directly accessed by the client does not really provide the service, it takes resources from other servers and returns the results to the user.

On how to solve CDN and other high concurrency problems to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report