2 months ago
I'm experiencing critical database performance issues on my paid Railway PostgreSQL service.
ISSUE:
- Simple queries like "SELECT 1" are taking 892ms
- This is pure connection overhead, not query execution time
- 470 record queries taking 400-500ms total
- This makes my application completely unusable
DATABASE DETAILS:
- Service: PostgreSQL
- Plan: Pro
- Database URL: postgresql://postgres:***@hopper.proxy.rlwy.net:43917/blazerail
- Region: US
EVIDENCE:
```bash
time psql "connection-string" -c "SELECT 1;" > /dev/null
real 0m0.892s # This is unacceptable
IMPACT:
- Application responses timing out
- Users experiencing 5seconds + page loads
- Service essentially unusable
This appears to be a Railway infrastructure/proxy issue, not my application. Normal database connections should be <50ms, not 900ms.
4 Replies
2 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 SSL PostgreSQL connection
?sslmode=disablesafe?🧵 Adding a replica on the European server slowed down my application load
If you find the answer from one of these, please let us know by solving the thread!
2 months ago
Heya!
Looks like you're connecting over a public network tcp proxy. You should instead use a private connection string for dramatically improved query times.
Status changed to Awaiting User Response Railway • 2 months ago
Status changed to Solved echohack • 2 months ago
echohack
Heya!Looks like you're connecting over a public network tcp proxy. You should instead use a private connection string for dramatically improved query times.
2 months ago
Hi, thanks for response.
I routed via the internal url and connected to my server and the Time to first response is close to 3 seconds and im in the same region as the server i connected it to. its wrapped via a public url.
I don't recall it being this slow.
Status changed to Awaiting Railway Response Railway • 2 months ago
2 months ago
Looks like this is related to your application. The private network is fast.
```
# time nc -v postgres.railway.internal 5432 < /dev/null
postgres.railway.internal ([fd12:5a1d:373a:0:2000:1:6153:2fac]:5432) open
real 0m 0.02s
user 0m 0.00s
sys 0m 0.00s
```
I'd take a look at how you're establishing this connection, your connection pooler, and how you have postgres configured.
Status changed to Awaiting User Response Railway • 2 months ago
2 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • about 2 months ago