Elevating Your CDN Service: A Guide to Quality Monitoring Best Practices

EdgeOne-Product Team
Aug 7, 2024

What is CDN?

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.

what is cdn
what is cdn

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.

How to Use CDN?

CDN can significantly optimize website access speed, enhancing user experience. So, how can CDN be used to accelerate website content?

  1. Select a CDN service provider (Provide suppliers of edge nodes, such as Tencent EdgeOne).
  2. Activate CDN services on the CDN service provider.
  3. Connect the domain name that needs acceleration.
  4. Configure the CNAME corresponding to the domain name on the domain name resolution provider to easily use CDN to accelerate the website.
     
how to use cdn
how to use cdn

If you are using Tencent EdgeOne, you can refer to this document.

What Should Be Considered When Using a CDN?

Using a CDN to accelerate a website mainly faces two issues:

1. CDN selection

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.

2. CDN quality monitoring

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.

How to Measure The Service Quality of CDN?

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.

1. Small files

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:

  • DNS time: DNS time measures the time taken for domain name resolution. The duration of DNS time is also related to CDN scheduling strategies.
  • TCP time: TCP time refers to the time taken to establish a TCP connection after resolving the IP. The process of establishing a TCP connection involves a fixed three-way handshake. TCP time reflects the capabilities of CDN nodes and scheduling strategies, with nodes closer to the user generally resulting in shorter TCP times.
  • Time to First Byte (TTFB): TTFB is a key metric for evaluating CDN performance in scenarios involving small files. It measures the time from when a user initiates a request to when the CDN responds with the first byte of content. This process is crucial for assessing the CDN's handling capability.

2. Large files

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:

  • Average transfer speed: Average transfer speed is used to measure the average speed of transferring large files.
  • Transfer time: Transfer time is used to measure the time required to download large files.

3. Video on Demand (VOD) / Live Streaming

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:

  • First Buffering Time: This is the time from when a user opens the video to when they see the video frame, influenced by domain name resolution, TCP connection, and the initial packet loading.
  • Freeze Rate: The freeze rate is an important metric for evaluating user playback experience. If out of 100 users, 90 experience smooth playback without any freezing, the freeze rate would be 10%.

How to Monitor CDN?

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.

Key Focus 1: Deployment of Probing Points

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.

Key Focus 2: Data Aggregation

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.

Key Focus 3: Alerting Capability

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.

Conclusion

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.

  • Acceleration: Edge nodes are closer to users, which greatly reduce the data access latency, avoid data transfer jitters, and guarantee the stability and effectiveness during the transfer of massive amounts of data. In addition, EdgeOne has many acceleration features, including dynamic/static data acceleration, cross-border acceleration, and smart route optimization, to efficiently support latency-sensitive businesses.
  • Security: Security protection services such as WAF and Anti-DDoS are provided. Nodes identify and block various layer-3/4/7 attack requests, cleanse DDoS attack traffic, and use the smart AI engine and bot policy engine to analyze the behaviors of web, bot, and CC attacks and update attack blocking policies. This helps prevent malicious requests from reaching your origin servers and guarantee a smooth and stable access to your business.

Tencent EdgeOne has now launched a free trial, Click Here or Contact Us for more information.