当前位置:网站首页>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 的缓存加速不适用于加速动态内容(即无法缓存实时变化的动态内容)
因此,对于动态资源而言,我们可以使用全站加速
的技术手段来实现(如路由优化、传输优化等)。
边栏推荐
- info [email protected] : The platform “win32“ is incompatible with this module.
- 使用mathtype编辑公式,复制粘贴时设置成仅包含mathjax语法的公式
- Add vector formula in rich text editor (MathType for TinyMCE, visual addition)
- C# 线程传参
- C thread transfer parameters
- tmall. product. schema. Get (product information acquisition schema acquisition), Taobao store upload commodity API interface, Taobao commodity publishing interface, Taobao commodity upload API interf
- Uniapp automated test learning
- qml 弹窗框架,可定制
- Introduction to C language -- array
- Makefile separates file names and suffixes
猜你喜欢
Have you learned the wrong usage of foreach
C code audit practice + pre knowledge
[Space & single cellomics] phase 1: single cell binding space transcriptome research PDAC tumor microenvironment
Introduction to mathjax (web display of mathematical formulas, vector)
Large top heap, small top heap and heap sequencing
[untitled] leetcode 2321 Maximum score of concatenated array
【无标题】LeetCode 2321. 拼接数组的最大分数
Ad20 cannot select the solution of component packaging in PCB editor
Makefile 分隔文件名与后缀
Introduction to C language -- array
随机推荐
Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)
4. Array pointer and pointer array
socket(套接字)与socket地址
Add vector formula in rich text editor (MathType for TinyMCE, visual addition)
【C语音】详解指针进阶和注意点(2)
C#代码审计实战+前置知识
【apipost】使用教程
info [email protected] : The platform “win32“ is incompatible with this module.
OpenCV调用USB摄像头的点滴
C # delay, start the timer in the thread, and obtain the system time
Xilinx Vivado set *.svh as SystemVerilog Header
obsidian安装第三方插件——无法加载插件
MFC console printing, pop-up dialog box
记一次报错解决经历依赖重复
Slashgear shares 2021 life changing technology products, which are somewhat unexpected
Socket and socket address
Why can't browsers read JSX?
PTA题库 ===>复数四则运算,一帮一,考试座位号(7-73)
LeetCode 209. 长度最小的子数组
C语言实现N皇后问题