Egress routing sending EU traffic via US-West (sjc) — suspected BGP issue
diogogfre94-ai
HOBBYOP

a month ago

Service uses Cloudflare Tunnel (cloudflared) in region AMS (EU West).

Problem: the cloudflared connector is registering to Cloudflare edge data centers in San Jose (location=sjc11/sjc06/sjc01 in the connector logs), instead of European ones. This adds ~400ms+ per request (external latency ~470ms vs ~11ms app internal response time), with p95 spikes up to ~15s.

This looks like the same "non-EU routing for EU traffic" egress issue you've BGP-fixed before (e.g. the Amsterdam/Europe and the Asia-Southeast routing cases).

Could you check for a suboptimal BGP route sending my AMS egress traffic out of Europe?

CPU/RAM are normal — this is network routing, not the app.

$10 Bounty

2 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 29 days ago


p14s3k
HOBBY

a month ago

Cloudflare Tunnel (cloudflared) doesn't let you pin a connector to a specific edge region - the connector reaches Cloudflare's edge via anycast IP addresses, and which physical PoP you land on (ams vs sjc) is decided by whichever network path your local upstream ISP/BGP table considers "closest" at the anycast level, not by anything cloudflared itself configures. The only region override cloudflared exposes is --region us, which is for FIPS compliance and has nothing to do with picking EU vs US edges.

You can try turning the tunnel on and off, hoping Cloudflare will assign routing somewhere closer. But this is neither guaranteed nor permanent (after restarting, routing may look different).


diogogfre94-ai
HOBBYOP

a month ago

Thanks @p14s3k. Agreed that cloudflared can't pin an edge region and that, region us is irrelevant here.

But the anycast decision is driven by Railway's egress BGP, not my local ISP. The connector runs INSIDE Railway's network (AMS), so which Cloudflare PoP the anycast resolves to depends on how Railway announces/routes its egress traffic.

This is the exact pattern Railway staff have BGP-fixed before:

Could a Railway staff member check the egress route for this project?

Connector is in AMS but registering to sjc01/06/08 (San Jose). Extra data: I already switched the tunnel to HTTP/2 (TUNNEL_TRANSPORT_PROTOCOL=http2), which removed the p95 spikes, but the ~335ms fixed network leg and residual 502s remain, which is consistent with the cross-continent path, not the app (app responds in ~11ms internally).


Welcome!

Sign in to your Railway account to join the conversation.

Loading...