Unusually high latency (~147ms) on private network between services in same region (EU West)
6dbf2jj6n4-a11y
HOBBYOP

13 days ago

Hi,

I'm seeing consistently high latency between my app service and Postgres database service, both deployed in the EU West region, communicating over Railway's private network (postgres.railway.internal).

I ran a diagnostic that executes 10 sequential SELECT 1 queries directly through the DB cursor (no ORM/framework overhead, using a single reused connection):

dotaz 1: 1209.8 ms (initial connection handshake)

dotaz 2: 147.2 ms

dotaz 3: 147.1 ms

dotaz 4: 147.3 ms

dotaz 5: 147.2 ms

dotaz 6: 147.3 ms

dotaz 7: 147.2 ms

dotaz 8: 147.1 ms

dotaz 9: 147.1 ms

dotaz 10: 147.1 ms

After the initial connection, every single subsequent query takes almost exactly 147ms, with essentially no variance. This is happening on a persistent, reused connection (Django CONN_MAX_AGE=600), so it's not a reconnect-per-query issue on my side.

For two services in the same region communicating over the private network, I'd expect single-digit millisecond latency, not ~147ms per round trip. Both app and Postgres CPU/RAM usage are near-idle during these tests, so it doesn't appear to be a resource-contention issue.

Details:

Project: exemplary-mindfulness / RenteX 2026

Plan: Hobby

App service region: EU West

Postgres service region: EU West

Connecting via: PGHOST=postgres.railway.internal (private networking)

Could you help me understand whether this is expected behavior for this plan/region, or if there's a configuration issue on either side? This latency is significantly impacting page load times across our admin application (each page typically issues 5-10 DB queries, so this compounds to multi-second load times).

Thanks!

$10 Bounty

1 Replies

Railway
BOT

13 days ago

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

Status changed to Open Railway 13 days ago


Anonymous
FREETop 10% Contributor

13 days ago

A flat 147ms per reused query points to cross region routing rather than Postgres execution.

Check the RAILWAY_REPLICA_REGION variable inside both running services to confirm their actual regions.

Railway migrates attached volumes on region change so recreating the database is unnecessary.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...