Cloudflare selects distant CDN

To begin with, I would like to thank all the kind souls who offer their time and help. I have small ecommerce store hosted on VPS located in Poland (paying yearly ~ 120 dollars). Currently selling mainly in Poland, but extending our boundries for whole Europe. I would like to benefit from Cloudflare security and performance, but with performance there is a problem. VPS Origin Server is in Olsztyn (175km from Warsaw, 390km from my location - Glogow). When testing from my location (Glogow) cdn-cgi/trace shows colo=IAD. As far as I know IAD stands for Ashburn, US* ~ 7000km away. 😭 When testing from server location (Olsztyn) the cdn-cgi is for Warsaw, which is fine ~ 175km. The question is: How do I fix it that cloudflare selects IAD location for my CDN? Below the results for requests from my location (Glogow). In future I wanted to buy Cache Reserve, but this won't reduce this delay. Right now I'm getting to know Cloudflare for around 4 days (as backend developer), using Free Version, probably paid subscription would solve the issue, but maybe not pro, not business just Enterprise? But who affords to pay atleast 20$ per month (or maybe 1000$), when my whole infrastructure costs 10$ monthly? I checked other 3 bigger companies from Poland, and I get connected to colo=FRA from them. 1. Request [DNS only] [from Glogow] loading html doc ~ 90ms loading image ~ 140ms 2. Request [DNS proxied] [from Glogow] (cache MISS for image) loading html doc ~ 400ms loading image ~ 760ms 3. Request [DNX proxied] [from Glogow] (cache HIT for image) loading html doc ~ 390ms loading image ~ 290ms
15 Replies
Flare
Flare•3w ago
Take a look here to see why the Cloudflare datacenter you are routed towards isn't always the closest geographically: https://www.cloudflare.com/en-gb/learning/cdn/glossary/anycast-network/
Kuba Faraway
Kuba Faraway•3w ago
I will read more about how it works, but I think there is no way to fix if ISP makes this decision?
Erisa
Erisa•3w ago
Sometimes you can circumvent their routing by using a VPN, but that's about it I'd reach out to your ISP with these details
Kuba Faraway
Kuba Faraway•3w ago
In this case why my website has colo IAD and other websites FR? So according to the docs, Cloudflare Anycast should direct traffic usually to the nearest data center unless they are overloaded or ddos attack is performed.
Erisa
Erisa•3w ago
Which other websites are you trying, what plan are they on? Free and lower tiered paygo plans have deprioritised routing sometimes
Erisa
Erisa•3w ago
I don't know what plans these websites are on so those urls mean nothing to me
Kuba Faraway
Kuba Faraway•3w ago
Yes, I also have no idea. But found some smaller sites https://aniagotuje.pl/cdn-cgi/trace (FRA) https://poprostupycha.com.pl/cdn-cgi/trace (IAD) https://www.echoshop.pl/cdn-cgi/trace (FRA) I could use VPN, but right now i'm testing how cloudflare would behave for ordinary user/customer without VPN. I don't get the part that my ISP selects the IAD location if cloudflare has its anycast network. My <home> network provider is T-mobile with cellular network or you mean ISP - from VPS server SprintDataCenter (in Olsztyn)
Erisa
Erisa•3w ago
Routing is a two way thing, Cloudflare advertises its anycast network at hundreds of locations and its up to the ISP and their routing agreements to determine which ones they route to in which scenarios. For example the ISP may not have the right routing in place to reach Cloudflares datacenter in one place, so it reroutes to another place There is also the consideration that Cloudflare's anycast IPs and their routing often will differ by zone plan level, for free plans less datacenters are available
Kuba Faraway
Kuba Faraway•3w ago
Does number of routse also differ between PRO and BUSINESS, BUSINESS and ENTERPRISE ?
Erisa
Erisa•3w ago
Yes but not as much You can also get the best routing on any plan by enabling Argo Smart Routing but that will cause you to be charged for bandwidth and can get costly if you use a lot of bandwidth
Kuba Faraway
Kuba Faraway•3w ago
I had no idea shopify is supporting cloudflare. Anyway thank you for your unmeasurable support.
Erisa
Erisa•3w ago
Shopify are a Cloudflare customer So all Shopify sites are inherently using Cloudflare through that
Kuba Faraway
Kuba Faraway•3w ago
Makes sense for saas application. My background lies on wordpress, so I didn't have much experience with other popular cms.
Ryder Cragie
Ryder Cragie•3w ago
Just out of curiosity, how did you figure that out?