如何预热CloudFront边缘服务器的缓存? [英] How to pre-warm CloudFront edge servers' cache?

查看:521
本文介绍了如何预热CloudFront边缘服务器的缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个要求,我们要预热特定CloudFront分发的所有边缘服务器的缓存.为此,我们将需要将一些呼叫定向到所有边缘服务器.有什么方法可以识别区域内或全局的所有边缘服务器?

We have a requirement where we want to pre-warm the cache of all the edge server for a specific CloudFront distribution. For this, we will need to direct a few calls to all the edge servers. Is there any way of identifying all edge servers within a region or globally?

例如:

浏览此处提供的信息时: http://aws.amazon.com/cloudfront/details/

When going through the information available here: http://aws.amazon.com/cloudfront/details/

我发现亚洲内部有多个边缘服务器,以孟买(印度)和香港为例,我有兴趣将一些HTTP调用定向到这些边缘服务器.我怎样才能做到这一点?如果我能获得所有这些服务器的身份,那就太好了.

I found that there are multiple edge servers within Asia, lets take Mumbai (India) and Hong Kong for example, I am interested in directing a few HTTP calls to these edge servers. How can I achieve this? If I can get the identity of all these servers, that will be great.

此外,我们最初想到的是以下方法: 在所有地区都有一个微型实例,并从这些地区访问我们的资产.

Also, we originally thought of the following approach: Have a micro instance in all the regions, and access our assets from them.

但是这种方法存在问题.从CloudFront文档中,我已经了解到边缘服务器之间没有层次结构,如果任何边缘服务器没有所需的资产,它将直接向Origin服务器索要该资产.现在,一个区域可以具有多个边缘服务器.如果在一个区域内,所有边缘服务器都没有所需的资产,那么它将无法实现此目的. 因此,我的问题是如何确保一个区域中的所有边缘服务器在其缓存中都具有必需的资产?

But there is a problem with this approach. From CloudFront documentation, I have come to understand that there is no hierarchal structure between the edge servers, if any of the edge server does not have the required asset, it directly ask Origin server for that asset. Now, a single region can have multiple edge servers. If within a region, all the edge servers are not having the required assets, then it defeats the purpose of doing this exercise. So, my question is how to ensure that all the edge servers in a region have the required assets in their cache?

请注意,内容本质上是静态的.而且,如果不可能覆盖所有边缘服务器,那么即使有一种方法可以覆盖70%的边缘服务器,我也想尝试一下.

Please note that the content is static in nature. And if covering all edge servers is not possible then even if there is an approach which can cover, lets say, 70% of the edge servers, I would like to try that.

推荐答案

问题是,如果每个人都将对象预缓存到某个边缘位置,那么所有边缘位置都会用光空间,因为它们会被可能会或可能不会访问的对象所淹没.现在,边缘位置仅缓存用户正在访问的对象,如果服务器上没有更多空间,则将转储最近未访问的对象.我不确定如果是服务,预缓存的方案将如何工作.

The issue is, if everyone pre-cached objects to a edge location all of the edge locations would run out of space because they would be flooded with objects that may or may not be being accessed. Right now the edge location only caches objects that are being accessed by users and will dump objects that have no been accessed recently if there is no more room on the server. I am not sure how a pre-cached scenario would work if it were a service.

除非您知道要长时间保持稳定的流量,否则预热可能根本无效.如果其他客户对象获得的流量比您自己的对象更多(或更近),CloudFront很有可能会使您的对象过期,从而为其他客户对象腾出空间.一旦发生这种情况,您将完全失去可以执行的任何预热的优势.

Unless you know that you're going to be getting a steady flow of traffic over an extended period of time then pre-warming simply may not be effective. CloudFront may very well expire your objects to make room for other customers objects if they're getting more (or more recent) traffic than your own. Once that happens you've completely lost the advantage of any pre-warming you're able to perform.

这篇关于如何预热CloudFront边缘服务器的缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆