a month ago
I have done extensive testing and am running into a strange issue where while railway's network logs claim that my app is taking 150-400ms to respond, if I go on the box my response times are <3ms.
Is this normal?
32 Replies
a month ago
From where are the requests being made? And do you only see this latency in logs?
I was seeing the latency in the HTTP logs, but when I turned on caddy logging that went away. However cloudflare still reports that time in the cfOrigin timing
e.g. I have a request id (Ify-vzrQQbabZucVezItjw) where it was 18ms in the app, but Cloudflare reports (and I obsurved) 350ms of latency in Railway
Attachments
Attachments
a month ago
Cloudflare proxied is seeing some increased latency yes
And no, it is not normal, team is aware
a month ago
It would resolve the latency issue yes
Would Railway still handle SSL termination or would I need to enable it in Caddy?
a month ago
Railway handles that for you
Caddy within Railway is generally unrecommended, unless you specifically need additional behaviour that Railway doesn't support by default
Yeah, I need it to reverse-proxy between 3 different independent backends and potentially other services (marketing SSR, vite PWA and Bun API)
a month ago
WIll let you know once the proxied issue is resolved
That annoying cloudflare trakcing script isn't included anymore either. Much better ❤️
Ohh, this is really interesting... US, EU and Asia monitors all dropped but Australia specifically shot up from having the best times to the worst (~500ms). We don't do buisness there but that is a facinating find 🤔 . I wonder if cloudflare has a way around their one cable bottleneck that only applies to the proxy
a month ago
Could you run a traceroute to 69.46.46.46 from Australia?
a month ago
We have an Australia CDN POP in the works - once that’s online, you’ll see better latency from AUS
a month ago
Update: the Melbourne POP is online now 🙂
Nice! I have no buisness need in AUS but I found it to be a very interesting side effect and worth sharing 🙂
a month ago
We've been seeing this consistently, but I am not sure where the issue lies exactly.
Railway Metrics look good on the container, though they are very generalized (p50 etc), so I'm not sure how much I trust them.
For requests in the browser, we see this time mostly under "Waiting for server response". We've profiled our application, and there is a significant mismatch. For some requests, we handle these in <2ms, but both Railway and the browser report in excess of 150ms.
I thought this was maybe an nginx/fpm issue, but if I SSH into the container and execute requests locally with curl, we see figures much closer to what we've profiled on the PHP side.
FWIW, we've disabled Cloudflare Proxy for these tests (it's been off for days, actually).
a month ago
I get the feeling that the issue is somewhere between Railway Edge <-> RW Proxy, or between
RW Proxy <-> Container, but I'm not sure what I can do to identify which.
a month ago
a month ago
Please could you answer the following so I can understand if this is expected latency or a routing issue:
- Where you are in the world (country)
- Where your Railway deployment is located (region)
- The value of
popwhen you visit https://railway.com/.railway/cdn-trace
a month ago
I did create my own thread (https://discord.com/channels/713503345364697088/1514099639710912563) for this, if you'd prefer to keep it all there? I'm not sure it's the same issue.
a month ago
Let’s talk there then
@Thaumanovic according to the bot at least upstreamRqDuration is the reported latency from the edge to the application... in my case it was also reporting long times when using the cloudflare proxy.
Not sure if that is helpful. Best of luck ❤️
19 days ago
Quick update on the latency you reported. We've rolled out a series of edge changes over the past week, tied to our new CDN, that should address the intermittent TTFB spikes.
Are you still seeing slow requests? If so, send a few X-Railway-Request-Id values from recent slow ones with rough timestamps, and we'll trace them through the edge to confirm whether anything's still off on our side.
Railway Team