I started noticing increased latency for certain requests so I took a look at the response headers and noticed that some fly-request-id values are passing through regions much further away. I’m requesting from New Jersey so I expect requests to pass through ewr/lga, but I’m seeing requests go through sea:
You can even notice that it passes through EWR for the Cloudflare proxy, but the fly-request-id suggests it goes through sea, which would explain the increased latency.
The websocket request however goes through the expected region:
We’re checking this out on our end, but we might want to also rule out Cloudflare’s role here. They’re directing the traffic as it leaves their network in EWR, but the fly-request-id tells me that it’s hitting our network in a different region.
You might want to check how traffic looks on an endpoint that doesn’t go through them for comparison.
What does it look like when you run curl -IL debug.fly.dev from your client? Since this isn’t behind Cloudflare, that’ll help us pinpoint the issue a bit more.
The debug curl is fine, returns lga as expected, but then again so does the Websocket request that also goes through Cloudflare. The weird thing about this is that only some subset of requests appear to route through the distant sea region, even though all of them pass through Cloudflare.
This is entirely up to CloudFlare. I do not know why they are routing some requests to Seattle and some to New Jersey. I think it’s worth asking their support folks if they know what’s up.
Appreciate your feedback, I’ll look further into it on Cloudflare’s side. It’s particularly puzzling because cf-ray header shows “EWR” so you’d think it got the right region/data center.