当前位置:网站首页>CDN 在游戏领域的应用
CDN 在游戏领域的应用
2022-07-02 11:56:00 【云计算-Security】
一、什么是 CDN ?
CDN(Content Delivery Network),即内容分发网络,是由多个边缘服务器节点组成的分布式网络组。其利用全局负载均衡技术将用户的访问指向离用户最近的工作正常的流媒体服务器上,由流媒体服务器直接响应用户的请求。
二、为什么使用 CDN ?
实际上使用 CDN 技术可以带给我们游戏客户更佳的游戏体验,因为我们都知道,在没有使用 CDN 技术的时候,每次的资源请求都会请求源 Host 服务器,如果在高并发的场景下,源 Host 服务器将会承担更多的压力,甚至存在宕机的可能性。
所以使用 CDN 技术主要有以下作用:
- 分担源站压力;
- 避免网络拥塞;
- 加速网站内容分发,提高资源访问速度。
三、CDN 应用场景
1、静态文件分发
- 图片文件;
- CSS 文件;
- JS 文件;
- …
2、大文件下载
- 游戏安装包;
- 升级程序包;
- 应用更新;
- …
3、音视频点播
- 转码;
- 解码;
- 存储;
- …
以上的场景均适用于游戏(当然不局限于游戏)、影视、新闻媒体等领域。
四、CDN 加速原理
假设加速的域名为
www.zhurse.com
1、客户访问 www.zhurse.com
- 本地 DNS 解析;
- 返回域名的 CNAME 域(
www.cdcd.example);
2、本地 DNS 向 CDN 的 DNS 调度系统请求 www.cdcd.example 的解析记录,并为其分配最佳 CDN 节点的 IP 地址,然后返回给本地 DNS。
3、本地 DNS 获取 CDN 的 DNS 调度系统返回的最佳 CDN 节点 IP 地址后,并将最佳节点 IP 地址返回给用户,用户从而获取到最佳 CDN 节点的 IP 地址。
4、用户向最佳 CDN 节点 IP 地址发起对该资源的访问请求。
- 如果该最佳 CDN 节点已缓存该资源,则会将请求的资源直接返回给用户,此时请求结束。
- 如果该最佳节点未缓存该资源或者缓存的资源已经失效,则节点将会向源站发起对该资源的请求。获取源站资源后结合用户自定义配置的缓存策略,并将资源缓存到 CDN 节点然后返回给用户。
小结
对于静态资源而言,如图片、视频、网站中的文件(html、css、js)、软件安装包等文件,使用 CDN 技术可看到明显效果。
对于动态资源而言,如 asp、jsp、php、perl 等文件,使用 CDN 是没效果的,也就是说 CDN 的缓存加速不适用于加速动态内容(即无法缓存实时变化的动态内容)
因此,对于动态资源而言,我们可以使用全站加速的技术手段来实现(如路由优化、传输优化等)。
边栏推荐
- Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
- [development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)
- C# richTextBox控制显示最大行数
- Li Chuang EDA learning notes 15: draw border or import border (DXF file)
- Fabric. JS manual bold text iText
- Record an error report, solve the experience, rely on repetition
- MFC A对话框调用B对话框函数并传参
- taobao. trades. sold. Get query the transaction data that the seller has sold (according to the creation time), Taobao store sales order query API interface, Taobao R2 interface, Taobao oauth2.0 trans
- Wechat applet uses towxml to display formula
- taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface
猜你喜欢

c语言入门--数组

Kityformula editor configure font size and spacing

Yolov6 training: various problems encountered in training your dataset

Dragonfly low code security tool platform development path

Fabric. JS zoom canvas

Socket and socket address

Advanced C language (realize simple address book)

富文本编辑器添加矢量公式(MathType for TinyMCE ,可视化添加)

Li Chuang EDA learning notes 15: draw border or import border (DXF file)

fatal: unsafe repository is owned by someone else 的解决方法
随机推荐
C语言中的printf函数和scanf函数
【C语音】详解指针进阶和注意点(2)
taobao. trade. Get (get some information of a single transaction), Taobao store order interface, Taobao oauth2.0 interface, Taobao R2 interface code docking and sharing
Fabric. Usage of JS eraser (including recovery function)
jmeter脚本参数化
电脑怎么设置扬声器播放麦克风的声音
fatal: unsafe repository is owned by someone else 的解决方法
##51单片机实验之简易验证码发生器
Ad20 cannot select the solution of component packaging in PCB editor
Btrace- (bytecode) dynamic tracking tool
Advanced C language (realize simple address book)
LeetCode 2310. The number of digits is the sum of integers of K
Large top heap, small top heap and heap sequencing
C#代码审计实战+前置知识
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
c语言入门--数组
Wechat applet uses towxml to display formula
Kityformula editor configure font size and spacing
LeetCode - 搜索二维矩阵
2、const 型指针