Must Know CDN Skillsets for Server Engineers

简介: This article uses to case studies to highlight must have skillsets for server engineers working with CDN. It will discuss CDN background and basic pri

In the cloud era, everyone is fighting to increase static resource loading speeds. In recent years, this alone has promoted the gradual popularization of CDNs, especially in rapidly expanding markets like China. I work in a company whose core business is centered on image sharing communities and therefore we rely heavily on image CDNs. This article uses to case studies to highlight must have skillsets for server engineers working with CDN. It will discuss CDN background and basic principles, distributed image storage, procedures and considerations for batch adding and switching CDNs as well as CDN access fault analysis.

Everything in this article is based from my own experiences. Background and principles of CDN and distributed image storage Before we start, let’s have a quick look at the basic CDN image storage architecture:

be0865209b1e49ac79b40ffe56fba1f7fed1ad92


These main principles of the above architecture can be illustrated in the diagram below:

db8edb81716f97f4944a64259b4e75626c5728f3

In this architecture we aim to switch the image access traffic for a certain domain name (a.mengkang.net) to the CDN. Here’s a rundown of the procedure:

  1. First, we need to collect statistics on the original domain name's access logs to find the image addresses with high access frequencies (around 200,000 addresses for example). Then, we will hand these addresses over to the CDN provider.

  2. The CDN provider will then do the warm-up crawling on the resources from the 200,000 addresses.

  3. After warm-up crawling is complete, when can change the domain name for a portion of a.mengkang.net to b.mengkang.net. Then, we need to resolve the b.mengkang.net CNAME to the CDN server's domain name, such as b.mengkang.ccgslb.com.cn.

  4. Using wget testing, we will access the images in the b.mengkang.net domain name to see whether or not they can be cached by the CDN.

  5. If the cache test is successful, we will switch some of the traffic from a.mengkang.net to b.mengkang.net. The O&M staff will monitor the back-to-source traffic situation and adjust the allocation of traffic accordingly.

Locating CDN resource access faults

Case Study 1:

Problem:

Recently we had a unique issue with large images. The access to the same image address sometimes succeeded and sometimes fails and when an image could not be accessed, individual image addresses access requests jumped to the game site's homepage.

We contacted the CDN provider's customer support and were told that the carrier's DNS was hijacked, but there was no problem with the CDN service (they seemed very passive). Here’s how we solved the problem.

Solution:

Let's use the following image as an example: http://f4.topit.me/4/2d/d1/1133196716aead12d4s.jpg

  • First, we confirmed that our origin site resources could be accessed and there was no problem with CDN back-to-source

    We used the wget command to bind the domain name host (here, we assumed the origin site IP is 111.1.23.214). This allows us to bypass the CDN and directly access our origin site:

    This confirms that the image can be accessed normally.

    e8b9ed2706c987f990954337ce5c7ed143e7a1c8

  • Then, we used wget -S to print out detailed HTTP header information

    9434f3a1fa4f89bf09bf04be754c3bcc4135183e

Using this request, we can clearly see that the request first connected to 123.150.50.14:80 and then experienced a 302 redirect. The header information clearly states: Powered-By-ChinaCache: HIT from CHN-TJ-7-3V2.6. This means that this is a problem with the CDN itself. Also, the redirect page also is a ChinaCache customer. Now that we had located the problem, the CDN provider could no longer deny responsibility and started fixing the problem.

Case Study 2:

Problem:

When accessing a certain webpage, the images in the CSS could not be accessed. However, images can be accessed by following the image address independently. Using wget --referer, we found that the problem was an incorrect anti-leeching setting:


8aad0243328afca0394f9b593e3fa3b508bd4d11


I reported this to customer service and they told me that they did not impose any restrictions and the problem is with our origin site. So we have to dig for evidences.

Solution:

  • First, we confirmed that there was no problem with the origin site by simulating browser access with a referrer

    6525aef74a3a0b336b141551c214d8e212f32e50

    At the same time, to bind the host, we also used another method: wget -e http_proxy

    cbc841a2dd9cb76ddbed2e3b8bbcd63ce178f6aa

  • Then, we requested directly, without binding the host

    93f0ddfedc66d1bb94bee4df6c18d94684ed2338

This clearly shows the domain name resolution process. The CDN DNS uses a predefined policy, returning the optimal IP, 111.202.7.252. Then, it returned 403. Only after I provided screenshots showing the two situations, the CDN customer service staff had to start fixing the problem.

Conclusion:

The above problems caused our development engineers to take on too much operations and management responsibilities. Recently we switched to Alibaba Cloud OSS for storage, and now we do not have to worry about the above problems anymore. There is no more back-to-source because we can directly store images on the cloud! It's that simple!

目录
相关文章
|
存储 缓存 边缘计算
什么是 CDN 边缘服务器 - Edge Server
什么是 CDN 边缘服务器 - Edge Server
565 0
什么是 CDN 边缘服务器 - Edge Server
|
2月前
|
域名解析 网络协议 安全
阿里云CDN
本文介绍阿里云CDN产品中涉及的基本概念,便于您更准确地理解和使用CDN产品。
61 5
|
8月前
|
弹性计算 缓存 运维
【运维知识进阶篇】用阿里云部署kod可道云网盘(DNS解析+CDN缓存+Web应用防火墙+弹性伸缩)(三)
【运维知识进阶篇】用阿里云部署kod可道云网盘(DNS解析+CDN缓存+Web应用防火墙+弹性伸缩)(三)
136 0
|
1月前
|
安全 网络安全 CDN
阿里云CDN HTTPS 证书配置流程
阿里云CDN HTTPS 证书配置流程
170 1
|
8月前
|
弹性计算 缓存 运维
【运维知识进阶篇】用阿里云部署kod可道云网盘(DNS解析+CDN缓存+Web应用防火墙+弹性伸缩)(二)
【运维知识进阶篇】用阿里云部署kod可道云网盘(DNS解析+CDN缓存+Web应用防火墙+弹性伸缩)(二)
132 0
|
8月前
|
缓存 弹性计算 运维
【运维知识进阶篇】用阿里云部署kod可道云网盘(DNS解析+CDN缓存+Web应用防火墙+弹性伸缩)(一)
【运维知识进阶篇】用阿里云部署kod可道云网盘(DNS解析+CDN缓存+Web应用防火墙+弹性伸缩)
158 0
|
9月前
|
缓存 前端开发 安全
阿里云CDN简介和优惠购买流程
阿里云CDN,首先需要了解什么是CDN。CDN全称是Content Delivery Network,即内容分发网络。CDN可以通过地理位置分发策略,使用户就近访问到离他们最近的服务器,从而提高访问速度,同时也能减轻源站流量压力,确保整个网站的稳定性。 阿里云CDN是阿里云推出的全球服务,涵盖全球范围内1250+节点。阿里云CDN采用的是BGP多线路中转技术,保证全局加速,让网络传输更加稳定。阿里云CDN可以帮助用户提高网站的访问速度,从而提升用户体验。同时,阿里云CDN还有许多其他的优势。
|
10月前
|
存储 缓存 边缘计算
阿里云CDN简介和使用流程
阿里云内容分发网络CDN(Content Delivery Network)是建立并覆盖在承载网之上,由遍布全球的边缘节点服务器群组成的分布式网络。阿里云CDN能分担源站压力,避免网络拥塞,确保在不同区域、不同场景下加速网站内容的分发,提高资源访问速度。(1)全网带宽输出能力达150 Tbps。(2)把静态内容缓存到边缘节点提高访问下载效率。
2067 0
|
11月前
|
边缘计算 CDN
《阿里云产品手册2022-2023 版》——CDN与边缘计算
《阿里云产品手册2022-2023 版》——CDN与边缘计算
169 0
|
11月前
|
CDN
《阿里云产品手册2022-2023 版》——CDN与边缘云
《阿里云产品手册2022-2023 版》——CDN与边缘云
107 0