Summary: CDN for public cloud products

1. Introduction

Since companies often provide CDN-related concepts, this article specifically summarizes them.

2. Product Description

Baidu Cloud's content distribution network CDN is an Internet-based distributed service platform that can accelerate content distribution and transmission on the network and improve network stability and access speed.

CDN mainly caches the static and dynamic resources of the website on nodes at the edge of the network, and delivers the information to users in the shortest distance, shortest time, and best route, thereby improving the response speed and experience of user access.

Baidu Cloud's CDN products provide the following services:

  • Content distribution acceleration service: By distributing the static and dynamic resources of the website to the network edge node closest to the user for caching, the user's access speed and responsiveness are improved.
  • Solve network bottlenecks: CDN can solve problems such as network bandwidth bottlenecks, network congestion, and packet loss through technologies such as load balancing, noise reduction, and optimization, and improve network stability and reliability.
  • Network security protection: CDN supports DOS/DDoS attack protection, Web Application Firewall (WAF) and other functions to improve the availability of websites and applications while ensuring network security.
  • Data analysis service: CDN provides detailed real-time data statistics and analysis services, which can help users understand website traffic, access hotspots, user sources, terminal devices and other information, and provide support for business optimization.

In short, Baidu Cloud's CDN is a high-performance, high-reliability content distribution network service that can provide users with fast, safe, and reliable network access and services.

3. What is the difference between a CDN server and a normal server?

The main function of the CDN server is to distribute and cache the content requested by users, thereby improving the access speed and experience of users. Therefore, the CDN server has relatively high performance requirements for the network card. Efficient network cards allow CDN servers to receive and process user requests faster, while providing higher network throughput and lower latency.

Ordinary servers mainly provide various services for clients, such as Web servers, application servers, database servers, etc., and have high requirements for CPU and memory. The CPU is mainly used to process various requests and logical calculations, while the memory is used to cache and store temporary data to improve the response speed and performance of the server.

Like ordinary servers, CDN servers also need the support of hardware resources such as CPU and memory. If the performance of the CDN server is insufficient, it may affect its processing speed and efficiency for user requests. Therefore, when selecting a CDN service provider, the configuration and performance of its hardware resources need to be considered to ensure the stability and high availability of CDN services.

CDN servers have high performance requirements for network cards, while ordinary servers mainly have high performance requirements for CPU and memory, but both require sufficient hardware resources to ensure the performance and reliability of their services.

The difference between CDN servers and ordinary servers mainly lies in their application scenarios, working modes, and performance requirements.

  • Different application scenarios Ordinary servers are usually used for hosting, deployment and management of services such as websites, applications, and databases, and mainly provide functions such as computing resources and storage resources. The CDN server is specially used to distribute static and dynamic resources, including pictures, videos, audio, software, etc., through caching and multi-node distribution technologies, to speed up users' access to these resources and improve user experience.
  • The working mode is different. Ordinary servers usually perform tasks on demand, respond to user requests or complete computing and storage tasks for other applications. The CDN server uses large-scale caching and distribution technology to cache resources to multiple network edge nodes in a timely manner, so as to respond to user requests faster.
  • Different performance requirements: ordinary servers need to provide high-performance computing and storage capabilities to support a large number of business applications and user requests. The CDN server needs to provide high-speed, low-latency, and high-concurrency network access capabilities in order to better meet users' access requirements for resources.

To sum up, the main difference between CDN servers and ordinary servers lies in their application scenarios, working modes, and performance requirements. A CDN server is a server specially used to optimize resource distribution and user access experience. It needs to have the characteristics of high speed, low latency, and high concurrency to meet the growing needs of Internet applications.

4. Will CDN servers and CDN clusters and networks composed of CDN servers use special software? What software do you use?

CDN servers and CDN clusters composed of CDN servers usually use specially designed software and algorithms to achieve content distribution and network acceleration functions.

The following are some software and technologies commonly used by CDN servers:

  • Nginx: Nginx is a high-performance web server. With CDN software, it can realize the distribution of static files and improve access speed and availability.
  • Squid: Squid is an open source web cache server that can cache commonly used static content in CDN nodes to reduce the load on the origin server and improve user experience.
  • LVS: LVS (Linux Virtual Server) is a virtual server software under Linux, which can realize TCP and UDP load balancing, and improve service availability and response performance.
  • HAProxy: HAProxy is a high-performance load balancing software that supports load balancing of TCP and HTTP protocols, and can perform functions such as content distribution and health check. =
  • CDNaaS platform: CDNaaS platform is a cloud-based global network acceleration service, which can optimize site content transmission and access speed through intelligent routing and edge nodes, and improve user experience worldwide.
  • In short, CDN servers and CDN clusters use specially designed software and algorithms to achieve content distribution and network acceleration. Commonly used software includes Nginx, Squid, LVS, and HAProxy. The CDNaaS platform is a cloud-based global network acceleration service.

5. The currently used CDN

Blue Flood (Commercial CDN)

Own CDN

  • Distinguish between large file CDN and small file CDN
  • Distinguish between dynamic CDN and static CDN, general platforms use dynamic CDN (php...), games use static CDN (JS...)
  • The back-to-source method is non-push, and the longest period of back-to-source is 3 months.

6. Purpose of using CDN

The use of CDN is to solve several problems caused by clients accessing the origin site:

  • A large number of visits to the origin station cause excessive access pressure on the origin station
  • For some clients, the source site is far away physically or on the network, and the access speed is low.

Seven, the principle of CDN

  • Copy the web resources of the source site to CDN sites across the country, so that clients can access nearby web sites, improve the speed of web resource access, and reduce the access pressure of the source site
  • There are two types of copy of web resources: "push" and "non-push" (pull), which can be configured according to the actual situation
  • CDN generally "returns to the source" on a regular basis, and the time limit here can be configured but there is a maximum time limit.

Eight, back to the source

Generally speaking, back-to-origin in CDN refers to the process that when a user requests a resource that does not exist in the CDN cache, the CDN node will request the resource from the origin server.

Specifically, back-to-origin means that the CDN node sends an HTTP request to the origin server, obtains and caches resources on the origin server, and then caches the resource on the CDN edge node, so that subsequent access requests can get responses more quickly.

The overall working principle of CDN is to provide high-speed and reliable content distribution services to users around the world.

When a user requests content from the CDN, the CDN node will provide the content from the nearest edge node to ensure that the user gets the fastest response and the best user experience. However, if the user requests a resource with a large amount of access, which exceeds the capacity of the CDN edge node, the CDN node will determine that the resource does not exist in the cache, and then perform a back-to-source operation, obtain the resource from the origin server, and cache it in the CDN On edge nodes, thereby improving resource acquisition speed and cache hit rate.

The frequency and traffic of back-to-origin are one of the key factors affecting CDN cost and performance. If the frequency of CDN back-to-origin is high, the traffic will also increase accordingly, thereby increasing the cost and network load of the CDN, and reducing the performance and reliability of the CDN.

Therefore, in order to improve the efficiency and performance of the CDN, it is necessary to set reasonable CDN caching policies and back-to-origin rules according to actual business needs to ensure the stability and efficiency of the CDN.

9. Differences between CDN edge nodes and CDN central nodes

CDN edge nodes and CDN central nodes are two different server nodes in the CDN architecture, and they have some differences in function, location, and service scope.

  • Different functions: CDN edge nodes are mainly responsible for caching and distributing content requested by users. These nodes are distributed all over the world to provide users with faster and more stable services. The CDN central node is usually in the data center or the computer room of the cloud service provider, and is mainly used to store and manage the core data and business logic of the CDN, such as domain name resolution, resource scheduling, load balancing, etc.
  • Different locations: CDN edge nodes are usually distributed all over the world in order to provide users with faster and more stable services, and at the same time reduce the load pressure on the origin server. The CDN central node is usually located in the data center or the computer room of the cloud service provider, as the CDN business centralized management and scheduling center.
  • Different service scopes: The service scope of CDN edge nodes is mainly for end users, providing users with faster and more stable content distribution services. The CDN central node is mainly for CDN service providers and origin servers, and provides core data management, business scheduling and load balancing services for other nodes in the CDN architecture.

In general, in the CDN architecture, CDN edge nodes and CDN central nodes play different roles. They play a vital role in content distribution, management scheduling, and business services, and are important components of the CDN network. .

10. Principles of CDN Acceleration

As shown in the figure above, the detailed steps of CDN acceleration are as follows:

  1. my.com Addresses for website user inquiries  ;
  2. request authoritative DNS;
  3. return configured CNAME:  my.com.a.bdydns.com;
  4. Request  my.com.a.bdydns.com the corresponding IP;
  5. Return the IP of the access point closest to the user according to intelligent scheduling;
  6. The IP address returned by LocalDNS  my.com is cached;
  7. Initiate an HTTP/HTTPS request to the CDN node to access  my.com the content;
  8. CDN accelerates the link through Baidu Smart Cloud, and forwards the request to the multi-line central node;
  9. The central node initiates a back-to-source request to the source station;
  10. The source station returns a response to the central node;
  11. The central node and the edge node return the response to the user and cache the response content.

11. Explanation of CDN terms

Domain name : The name of a computer or computer group on the Internet consisting of a string of names separated by dots, used to identify the electronic location of the computer during data transmission (sometimes also refers to geographical location, geographical domain name, refers to a local area of ​​administrative autonomy). A domain name is a "mask" on top of an IP address. The purpose of a domain name is to facilitate remembering and communicating the addresses of a group of servers (website, email, FTP, etc.).

CNAME domain name : After Baidu Smart Cloud CDN accesses the accelerated domain name, the system assigns a "CNAME domain name" to the corresponding domain name, and then completes the CNAME configuration of the accelerated domain name at the domain name service provider to point to this CNAME domain name. After the configuration takes effect, the work of domain name resolution will be officially transferred to Baidu Smart Cloud, and all requests for the domain name will be transferred to the nodes of Baidu Smart Cloud CDN.

CNAME record : Alias ​​record in domain name resolution. It is used to resolve a domain name to another domain name, and then another domain name provides an IP address. CNAME records allow you to map multiple names to the same server. For example, you have a server named "host.mydomain.com" (A record), and you want to use it to provide both WWW and MAIL services. Then you can set two aliases (CNAME) for this server in your DNS resolution service provider: WWW and MAIL, point the full names of these two aliases "www.mydomain.com" and "mail.mydomain.com" to " host.mydomain.com". After adding this CNAME, all requests to both CNAMEs will be redirected to host.mydomain.com.

DNS : Domain Name System, Domain Name System, a distributed database on the Internet that maps domain names and IP addresses to each other, enabling users to access the Internet more conveniently without having to remember IP numbers that can be directly read by machines. The process of obtaining the IP address corresponding to the host name through the host name is called domain name resolution (or host name resolution).

Edge node : It is the network node used by Baidu Smart Cloud CDN to cache the content of the customer's source site so as to quickly respond to requests from users in different regions. The edge node refers to the network node close to the user in the network structure, which has better response ability and connection speed to the access user than the source station. The CDN edge node caches the content with a large amount of visits on the server of the edge node, so as to improve the speed and quality of the website content accessed by the end users of the network.

Static content : Refers to the user accessing a resource multiple times, and the data accessed in different requests is the same content. For example: html, css and js files, pictures, videos, software installation packages, apk files, compressed package files, etc.

Dynamic content : Refers to the user accessing a certain resource multiple times, and the data returned in response is different content. For example: API interfaces, .jsp, .asp, .php, .perl, and .cgi files, etc.

Back-to-origin HOST : Namely, the back-to-origin domain name, the domain name of the site that the CDN node visits at the origin site when back-to-origin, see back-to-origin configuration for details . When there are multiple different sites on the server origin site, the CDN will determine which site the CDN will obtain resources from based on your back-to-source HOST domain name.

Origin site : The origin site refers to the website server where the user runs the business, and is the source of CDN accelerated data distribution. The origin station of Baidu Smart Cloud CDN can choose its own origin station or object storage (BOS).

12. Baidu Cloud CDN product functions

The service provided by CDN is simple and easy to use. Once the domain name and the corresponding source site address are added to the platform, the CNAME domain name will be provided automatically. Users only need to bind the domain name to be accelerated with the CNAME address to enjoy the acceleration service provided by CDN , allowing the user's website to achieve cross-operator and cross-regional services.

CDN can provide users with various functions:

Multi-domain, multi-service acceleration : CDN can not only speed up the loading of static web pages including maps, pictures, and documents, but also provide acceleration services for audio, download, and game services, so that the website can be accessed at high speed, effectively improving the user experience of the website experience.

Unified management platform

  • Supports accelerated addition, deletion, and modification of domain names and viewing of domain name information.
  • Support the customization of back-to-source address, anti-leech, expiration time, and refresh cache.
  • Supports starting and stopping of services.

resource monitoring

  • CDN provides domain name resource monitoring data reports and graphs, including: monitoring of egress traffic, back-to-source traffic, hit rate, number of visits and other index data, allowing you to check the operating status of domain names at any time.
  • Users can create alarm items for each parameter index through the resource monitoring system. When an alarm message appears, the system will automatically send a text message or email to the user.

Log download : Users can download business operation status logs through the CDN platform, which is helpful for users to further analyze data or archive.

Traffic balance : CDN sets up a cache server cluster for services connected to the CDN, and has a dedicated traffic allocation system to dynamically select high-performance caches for websites connected to the CDN to provide continuous and stable acceleration services for the website, even during peak access periods. It will not affect the user experience of the website due to network congestion.

Security

  • Using the CDN service, the address of the source site of the website will not be exposed on the public network, preventing the source site from being attacked unexpectedly.
  • The CDN monitoring system will monitor the service at any time and prompt an alarm in time to ensure the security of the service.
  • Support WAF: Realize Referer black and white list filtering and source IP black and white list filtering; CC attack defense, SQL injection defense, XSS attack defense, SSRF attack defense, local file call defense, remote file call defense, common stress test tool attack defense, common Scanner scan attack defense, high-risk system command call defense; prevent SVN, the function of common backup file leakage; prevent static file directories from calling executable files.

Refresh warm-up : CDN provides cache refresh and resource warm-up functions. Through directory refresh/URL refresh, you can regularly clear node cache resources, force CDN nodes to return to the source and obtain the latest files; through the preheating function, you can preheat popular resources during peak business hours, improving resource access efficiency.

Image Pornography : Based on the cloud computing platform, quickly scan massive data to detect whether the images accelerated by CDN are pornographic, which can help you save more than 90% of the human review cost.

Dynamic acceleration : A typical website is usually composed of static pages and dynamic pages. In the past, website acceleration generally used dynamic and static separation for acceleration, and CDN services do not need dynamic and static separation to achieve overall acceleration.

EdgeJS edge script : supports the execution of your own JavaScript code on the edge node, providing you with programmable custom edge configuration capabilities.

13. Application scenarios

website acceleration

  • CDN improves the speed of users' access to website pages and pictures, and the perfect monitoring mechanism ensures continuous and stable website services, effectively improving the access speed of static pages.
  • CDN can realize the overall acceleration of the whole site without the need for dynamic and static separation.

Very large file distribution

The national distribution of files with different granularities is accelerated, which solves the problem of slow and unstable transmission of large files such as online games, music, videos, and software. Learn more about storage distribution solutions .

Schematic diagram of the architecture:

video on demand

Support online on-demand acceleration services, such as on-demand acceleration of mp4 and flv video files. The main business scenario is video on demand. It is recommended to use the object storage BOS service, which can increase the speed of back-to-source and save the cost of near-back-to-source bandwidth.

Schematic diagram of the architecture:

live video

Baidu Smart Cloud VOD is based on large-scale real-time streaming computing clusters and powerful audio and video signal processing algorithms, combined with in-depth development and optimization of CDN technical services, to provide "clear and smooth, low latency, high concurrency" audio and video live broadcast services.

Schematic diagram of the architecture:

14. Node distribution

The CDN line is connected to the networks of China Telecom, China Unicom, China Mobile, Radio and Television, Railcom, Dr. Peng, Wasu, BGP, etc. The nodes cover more than 30 provinces and cities across the country, providing users with reliable services.

 

Guess you like

Origin blog.csdn.net/w2009211777/article/details/131247892
Recommended