This tutorial is deprecated in favour of https://www.cloudflare.com/en-gb/learning/cdn/glossary/anycast-network/
Archive
Why don’t I reach the closest datacenter to me?
Cloudflare is an anycast network, so where you are routed is determined by peering with ISPs. The shortest path geographically isn’t always possible due to peering agreements.
If you request a site hosted on Cloudflare from home:
- The domain resolves to a Cloudflare IP
- Your browser sends an HTTP request to that IP
- Your ISP’s routers consult their routing table and route the packets upstream to their transit provider ( COSTS MONEY )
- The packets traverse multiple hops to the nearest Cloudflare POP ( TAKES TIME )
- Those packets are taking up some of the ISPs capacity, making it unavailable for other competing packets ( TRAFFIC MANAGEMENT )
From this blog post
What is Peering?
To address these problems, large networks, hosting providers and CDNs will peer with each other. That is, to interconnect their networks directly. Put another way, cut out the middleman. If I request a site on Cloudflare and my ISP is already directly connected to the Cloudflare network, the packet will traverse fewer hops, my website will load faster, my ISP will pay less to their transit provider and they can allocate that bandwidth for other sites.
From this blog post
You can determine which Cloudflare data center your requests are going to by adding /cdn-cgi/trace
to the domain name. E.g. go to example.com/cdn-cgi/trace
in your browser (replacing example.com
with your domain name. You will then see colo=ABC
with ABC
being the airport code of the nearest major international airport to the data center.
Links and resources:
https://www.cloudflare.com/learning/cdn/glossary/anycast-network/
Tool to see where sites are routed based on plan. From fellow MVP, @Judge.
https://cloudflare-test.judge.sh/
https://support.cloudflare.com/hc/en-us/articles/203118044#h_22b01241-01a5-4bed-a897-6e97cff5c288
Bandwidth Costs Around the World
Tutorial Reference: CT-33
Reviewed: 08/21
This is a Community Tutorial, most are wiki posts, so can be contributed to by Regulars and MVPs here. If there is a tutorial you would like to see, you can request one here.
If you would like to provide any feedback on this tutorial, please post in the #Meta category, tag your post #TutorialFeedback and let us know the Tutorial Reference above.
Other great resources on this community include the Community Tips . These address best practices when configuring Cloudflare, how to fix issues you may see, and tools to troubleshoot. Also you can view Expert Tips, great posts on the community from people in the know that may help you with your issue.
We encourage users to check out these great resources and the Cloudflare Support Centre before posting