Skip to content

Why is CloudFront selecting a US POP when I'm in Europe?

0

TL;DR - I'm seeing this header in my Cloudfront responses: x-amz-cf-pop: DFW56-P1 I believe this is a US POP (Dallas Fort Worth?) . Sometimes I see ORD58-P4 which I believe is also a US POP.

Question: Are these US POPs, and if so, why am I being served by a US POP when I'm in London?

Background

Ive been trying to identify the cause of high latency in a Cloudfront distribution. I'm using a lambda function behind a Cloudfront distribution. The lambda is running in eu-west-2 (London, UK). If I hit the Lambda Function URL directly I see response times ~ 50ms (when warm). Going via Cloudfront takes ~ 500ms. Enabling origin shield brought it down to ~ 250ms.

Enabling the Server-Timings headers shows something like this: cdn-upstream-layer;desc="Origin Shield",cdn-upstream-dns;dur=0,cdn-upstream-connect;dur=8,cdn-upstream-fbl;dur=73,cdn-cache-miss,cdn-pop;desc="ORD58-P4",cdn-rid;desc="MrfV0_pVjjtGt4B7mbjHqMUuPRe95wsH5l9XcstLkoS2RA2KDFxMkA==",cdn-downstream-fbl;dur=170

My suspicion is the 170ms cdn-downstream-fbl is due to the request going over the Atlantic.

asked 2 years ago1.2K views
2 Answers
2
Accepted Answer

CloudFront relies on the location of your DNS resolver to route requests. It may be that you're on a corporate network or a VPN, that has a DNS resolver located in the US. To improve routing, please use the DNS provided by your (local) Internet Service Provider, located in the UK. Alternatively, use one of the public DNS services that support the EDNS-Client-Subnet extension to the DNS.

For more information, please refer to this blog post: https://aws.amazon.com/blogs/aws/improved-cloudfront-performance-with-edns-client-subnet-support/, and don't hesitate to ask further questions!

AWS
answered 2 years ago
EXPERT
reviewed 2 years ago
EXPERT
reviewed 2 years ago
0

Hi,

As said in official documentation https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowCloudFrontWorks.html#:~:text=DNS%20routes%20the%20request%20to,returns%20it%20to%20the%20user.

DNS routes the request to the CloudFront POP (edge location) that can best serve the 
request, typically the nearest CloudFront POP in terms of latency.

So, I have very often seen (I live in Europ) lots of situation where US web sites respond faster than other sites in Europe. AFAIK, it's due to the massive amount of transatlantic fiber cables and to the very minimal number of hops to reach them from Europe (often less hops than to reach site in other EU countries. In that case, geo distance is irrelevant.

This can be leveraged in CloudFront multi-region architectures: see https://aws.amazon.com/blogs/networking-and-content-delivery/latency-based-routing-leveraging-amazon-cloudfront-for-a-multi-region-active-active-architecture/

Best,

Didier

EXPERT
answered 2 years ago
AWS
EXPERT
reviewed 2 years ago
EXPERT
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.