当前位置:网站首页>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 的缓存加速不适用于加速动态内容(即无法缓存实时变化的动态内容)
因此,对于动态资源而言,我们可以使用全站加速的技术手段来实现(如路由优化、传输优化等)。
边栏推荐
- 传感器数据怎么写入电脑数据库
- YoloV6训练:训练自己数据集遇到的各种问题
- LeetCode 2310. The number of digits is the sum of integers of K
- mathML转latex
- obsidian安装第三方插件——无法加载插件
- Tmall product details interface (APP, H5 end)
- info [email protected] : The platform “win32“ is incompatible with this module.
- C RichTextBox controls the maximum number of lines displayed
- Add vector formula in rich text editor (MathType for TinyMCE, visual addition)
- Large top heap, small top heap and heap sequencing
猜你喜欢

Wechat applet uses towxml to display formula

C#代码审计实战+前置知识

geoserver离线地图服务搭建和图层发布

LeetCode 2310. The number of digits is the sum of integers of K

CTO如何帮助业务?

JMeter script parameterization

Ad20 cannot select the solution of component packaging in PCB editor

实现一个多进程并发的服务器

关于网页中的文本选择以及统计选中文本长度
[email protected] : The platform “win32“ is incompatible with this module."/>info [email protected] : The platform “win32“ is incompatible with this module.
随机推荐
[Space & single cellomics] phase 1: single cell binding space transcriptome research PDAC tumor microenvironment
求轮廓最大内接圆
geoserver离线地图服务搭建和图层发布
Have you learned the wrong usage of foreach
Large top heap, small top heap and heap sequencing
Record an error report, solve the experience, rely on repetition
【题解】Educational Codeforces Round 82
【NOI模拟赛】伊莉斯elis(贪心,模拟)
LeetCode 209. 长度最小的子数组
Fabric. JS free drawing ellipse
Add vector formula in rich text editor (MathType for TinyMCE, visual addition)
LeetCode 2320. Count the number of ways to place the house
Stm32-dac Experiment & high frequency DAC output test
tmall. product. schema. Get (product information acquisition schema acquisition), Taobao store upload commodity API interface, Taobao commodity publishing interface, Taobao commodity upload API interf
Advanced C language (realize simple address book)
可视化搭建页面工具的前世今生
4. Array pointer and pointer array
3. Function pointers and pointer functions
LeetCode 2320. 统计放置房子的方式数
解决el-radio-group 回显后不能编辑问题