Web front-end performance optimization_CDN (content distribution network), CDN working principle

What is CDN? How does it work?

  • A website usually puts all its servers in the same place. When the user base increases, the company must deploy content on multiple servers in different geographical locations.
  • In order to shorten the time of the http request, we should place a large number of static resources closer to the user.

Content distribution network CDN(Content Delivery Networks)

  • CDN is a group of web servers distributed in multiple different geographical locations, used to distribute content to users more effectively

The basic idea:
  try to avoid bottlenecks and links on the Internet that may affect the speed and stability of data transmission, so that content transmission is faster and more stable.
  By placing node servers everywhere in the network constituted by a layer of intelligent virtual network on the basis of the existing Internet, the
  CDN system can in real time according to the network traffic and the connection of each node, load status, distance to users and response time Such comprehensive information
  redirects the user's request to the service node closest to the user.

Infrastructure:

  • The simplest CDN network consists of a DNS server and several cache servers.
      1. The url entered by the user will be "translated" into the corresponding ip address through DNS resolution to find the CDN dedicated server.
      2. The CDN "gets" the user's IP address, and then cooperates with the regional load balancing device to select a regional load balancing device in the region to which the user belongs, and tell the user to initiate a request to this device.
      3. The "choice" basis in the above steps
        (1). The basis for selection includes: judging which server is closest to the user according to the user's IP address;
        (2). judging according to the content name carried in the URL requested by the user Which server has the content required by the user;
        (3). Query the current load situation of each server and determine which server still has the service capacity.

Guess you like

Origin blog.csdn.net/qq_43562262/article/details/108960943