Cloudflare Load Balancing Adds Significant Latency To Requests?

Hi Community - I have a ticket open with CF directly but thought I’d ask here too.

We have a static site hosted in AWS and Azure. We want to load balance between the two using a CF load balancer, but when we install it, our page render time goes from 300ms to a little over 500ms. I understand that adding a load balancer will increase latency a little, but that seems egregious.

We’ve tried to point the load balancer to an AWS ALB CDN and directly to the S3 bucket. On the Azure side, we’ve followed Cloudflare’s guidance and tried configuring the static site via the Internet routing endpoint and also via the Microsoft routing endpoint. We also configured an Azre CDN endpoint and that seem to knock 50ms off the total time, so it seems that Cloudflare isn’t routing into AWS and Azure very efficiently.

Has anyone else experienced this?

Cloudflare by default doesn’t cache HTML pages only other non-HTML static assets see https://developers.cloudflare.com/cache/about/default-cache-behavior. Unless you tell Cloudflare to cache HTML pages via Cache Everything Page rules.

So if you’re testing HTML pages, then depending on network distance between CF load balancer and your AWS/Azure origins, your requests will have to travel from CF load balancer to your origin which will add some latency. How much latency will depend on network distance between your origin and CF Edge/Load balancer servers.

You can test with webpagetest.org for geographical location tests to see what’s what in the inspection of the waterfall’s and the first HTML request’s details.

1 Like

Hi, yes I am aware that without something being cached, CF would have to traverse the distance to the origin. 200ms is enough latency to go from NYC to Tokyo however.

I’m specifically asking why it is taking Cloudflare 200ms to go from their POP or network to my origin? For example, I enter their Atlanta POP and our data is in AWS US-EAST-1 and Azure US-EAST which is in Ashburn, VA, barely 20ms from Atlanta. Why is it taking them 10x that?

If I stand up an Nginx proxy on Vultr in Atlanta and proxy it to those same AWS and Azure origins, the latency is increased by about 5ms.

AWS seems disinterested in peering with Cloudflare in some regions. If you deploy is a different AWS region does performance improve?

Cloudflare load balancing can do geo steering so you can optimize regions based on requests if Amazon decides it’s not Prime to connect

1 Like

AWS to CF latency actually isn’t too bad from most of their POPs, in our experience. Usually <= 1ms. But we are moving more workloads into Azure because of their Bandwidth Alliance partnership.

I was able to slash this in half by NOT using Geo Steering, which is how we originally had it configured. I’m not sure why Geo Steering doesn’t seem to actually be, well, geo steering, but I should have known that just letting Cloudflare do what they do best was the right approach.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.