CDN stands for Content Delivery Network, which effectively bypasses factors on the internet that could affect transmission speed and stability, and is designed to deliver digital content such as websites, videos, images, and software applications to users more efficiently.
By Caching static resources to nodes closer to users, eliminating the need to access servers over long distances. This not only speeds up access to these resources but also reduces server bandwidth pressure, effectively lowering server load.
CDN can significantly optimize website access speed, enhancing user experience. So, how can CDN be used to accelerate website content?
If you are using Tencent EdgeOne, you can refer to this document.
Using a CDN to accelerate a website mainly faces two issues:
The first step in using a CDN to accelerate a website is to choose a CDN provider. There are various CDN service providers, such as Tencent EdgeOne, Google Cloud CDN, Amazon CloudFront, Cloudflare CDN, etc. When selecting a CDN service provider, the primary consideration should be the quality of the CDN service, followed by other factors. After all, the primary purpose of purchasing CDN services is to speed up the website, making it crucial to choose a suitable CDN service provider.
After utilizing a CDN to accelerate a website, the CDN becomes a black box for us. Relying solely on the monitoring data provided by the CDN vendor to assess the quality of the CDN service is inadequate. Therefore, measuring the quality of the CDN becomes a bottleneck. If the CDN is unavailable or if it significantly increases latency, it could result in a loss rather than a gain.
To address these issues encountered during the use of CDN, the first step is to determine how to measure the service quality of a CDN. It is necessary to establish core metrics to quantify the data of the CDN acceleration process, using this data to assess the effectiveness of CDN acceleration.
The scenarios for using CDN acceleration can be divided into four categories: small files, large files, audio and video on demand, and live audio and video streaming. In these four scenarios, the first factor to consider is availability. Whether CDN can provide acceleration services normally is the premise of everything. The availability measurement of CDN services requires ensuring the availability of the origin server, and based on the method proposed in this article, monitoring of the origin server's services can also be conducted.
Small files typically refer to web assets such as html, js, jpg, png, css, etc. These files are most sensitive to latency.
When a frontend requests a network resource, the process can be analyzed in four steps: DNS lookup, TCP connection, request/response, and content transfer. Small files usually focus on the time taken for the first three processes, as the time taken for content transfer is minimal and of little significance.
The metrics for the first three processes are as follows:
Large files typically include some download installation packages, usually files larger than or equal to 10MB such as apk, rar, zip, etc. Compared to small files, the requirements for CDN quality are not as strict in the scenario of large files, with core metrics focusing on download speed or download time.
Here, the main focus is on two core metrics:
Video on Demand typically involves audio and video files like mp4, flv, mkv, wmv, while live streaming often uses protocols such as rtmp, hls, http-flv. The audio-video scenario is similar to that of large file transfers, but the quality requirements for CDN services are much stricter in this context.
Here, the main focus is on two core metrics:
Once the metrics for measuring CDN performance have been defined, the next step is to monitor CDN acceleration. It is necessary to build a platform to monitor the quality of CDN services, enabling continuous monitoring and ensuring quality through comparative analysis, alerts, and other means.
For CDN acceleration domain names, it is essential to access the domain names through numerous probing points to collect core metric data during the access process. After aggregating and storing this data, it can be further analyzed and used for comparison and alerting purposes.
To obtain the core metric data of CDN through accessing the accelerated domain names, it is crucial to deploy the programs that collect these core metrics to probing points in various regions.
The core metric data collected from each probing point needs to undergo data aggregation calculations. For instance, to obtain the DNS response time at a specific moment, you might need to average the DNS response times from all probing points at that moment or consider the 95th percentile.
Continuous monitoring of core metric data is essential, particularly for critical indicators like availability. Timely alerts should be issued when availability decreases.
Building a core monitoring system to oversee CDN service quality seems somewhat challenging based on the steps outlined above. Alternatively, existing monitoring platforms can be utilized to monitor CDN service quality.
The following section introduces how to monitoring CDN quality by using Tencent Cloud Observability Platform.
First, we create a probing task and select the corresponding task type. File download tasks correspond to scenarios involving small and large files, while audio/video on-demand and live streaming can be monitored using the audio and video experience task type. Select the probing points from the desired ISP (Internet Service Provider) and regions for monitoring, and after creating the corresponding probe tasks, the tasks will be distributed to each probing point for execution.
Tencent Cloud Observability Platform will aggregate the result data of the dial test points, and you can view the indicator data through multidimensional analysis. It also supports alarms, setting thresholds for corresponding indicators to trigger alarms promptly when the access quality of the CDN is abnormal.
Utilizing CDN for website acceleration is increasingly important. During the process of CDN service delivery, we need to continuously monitor the quality of the CDN service. If the CDN acceleration performance is not satisfactory, we should consider switching CDN providers.
Tencent EdgeOne provides an acceleration and security solution based on Tencent edge nodes to safeguard diverse industries such as ecommerce, retail, finance service, content and news, and gaming and improve their user experience.
Tencent EdgeOne has now launched a free trial, Click Here or Contact Us for more information.