简体   繁体   English

我可以将 cloudfront 与 route53 流量策略一起使用吗?

[英]Can I use cloudfront with a route53 traffic policy?

I have 12 instances of my app in 12 diff regions fronted by elbs我在 elbs 前面的 12 个差异区域中有 12 个我的应用程序实例

I use a geo based route53 traffic policy to route to diff regions我使用基于地理的 route53 流量策略路由到差异区域

Can I point a cloudfront distribution to that policy record as it's origin and will it just work?我可以将云端分发指向该策略记录作为它的来源吗?它会正常工作吗? Any caveats to using cloudfront and route53 this way?以这种方式使用 cloudfront 和 route53 有什么注意事项吗?

Putting multiple Amazon EC2 instances in 12 Regions is quite an investment.在 12 个区域中放置多个 Amazon EC2 实例是一项相当大的投资。 Presumably you are doing this to reduce latency for your users.据推测,您这样做是为了减少用户的延迟。

Amazon CloudFront has points-of-presence in over 200 locations, so it is recommended for serving static content . Amazon CloudFront 在 200 多个位置设有入网点,因此推荐用于提供静态内容 This typical means content that does not change between users, such as pictures, style sheets and script files.这个典型的意思是在用户之间不会改变的内容,例如图片、样式表和脚本文件。 It allows you to offload a lot of this traffic from your web servers, meaning that you could probably run fewer web servers.它允许您从 Web 服务器卸载大量此类流量,这意味着您可以运行更少的 Web 服务器。

Amazon Route 53 geo-routing is used to send traffic from specific countries to particular destinations (eg all requests from Germany are sent to a server with content in German). Amazon Route 53地理路由用于将流量从特定国家/地区发送到特定目的地(例如,来自德国的所有请求都发送到包含德语内容的服务器)。 However, given that you have distributed your traffic to multiple regions, it might be better for you to use Latency-based routing since this will direct traffic to a location that will provide the lowest latency for your users.但是,鉴于您已将流量分布到多个区域,您最好使用基于延迟的路由,因为这会将流量定向到可为用户提供最低延迟的位置。

Combining Route 53 and CloudFront might provide some advantages, depending upon how they are configured.结合使用 Route 53 和 CloudFront 可能会提供一些优势,具体取决于它们的配置方式。

Firstly, you published DNS Name will need to resolve to CloudFront so that it can serve content from all points of presence.首先,您发布的 DNS 名称需要解析为 CloudFront,以便它可以从所有存在点提供内容。 This is ideal for static content.这是静态内容的理想选择。

Next comes the question of how to configure the origin for content required by CloudFront.接下来是如何为 CloudFront 所需内容配置来源的问题。 This could be another DNS name that is configured in Route 53 for latency-based routing, which means that CloudFront will pull the content from a 'nearby' location rather than going back to a single origin.可能是在 Route 53 中为基于延迟的路由配置的另一个 DNS 名称,这意味着 CloudFront 将从“附近”位置提取内容,而不是返回到单一来源。 This will not matter much for cached content, but it could speed the delivery of dynamic content (that is, content that is different for each user).这对缓存的内容影响不大,但它可以加快动态内容(即每个用户不同的内容)的交付。

I would recommend that you perform tests for each of these options and determine which ones meet your performance goals, but also taking into account the expense for each option.我建议您对这些选项中的每一个进行测试,并确定哪些选项满足您的性能目标,同时还要考虑每个选项的费用。 For example:例如:

  • Option 1: Amazon CloudFront and ONE origin - This would be lowest cost, but might be too slow for dynamic content选项 1: Amazon CloudFront 和 ONE 来源 - 这将是成本最低的,但对于动态内容来说可能太慢
  • Option 2: No CloudFront, but multiple regions (as you are currently using) - This would be a considerably higher cost, but could serve the quickly traffic if using Latency-based Routing选项 2:没有 CloudFront,但有多个区域(如您当前正在使用的那样)——这将是相当高的成本,但如果使用基于延迟的路由,则可以为快速流量提供服务
  • Option 3: CloudFront + Multiple regions - Be careful how this is configured (it needs multiple levels of DNS) but this could be even faster than Option #2选项 3: CloudFront + 多个区域 - 请注意其配置方式(它需要多级 DNS),但这可能比选项 #2 更快

You should test each option and compare the results against your specific speed/latency goals.您应该测试每个选项并将结果与您的特定速度/延迟目标进行比较。 Then you should compare the cost of each option to see whether it is providing the desired cost/benefit ratio.然后你应该比较每个选项的成本,看看它是否提供了所需的成本/收益比。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM