5 months ago
Hi,
For the past three weeks or so the response of my application has been very SLOW.
CRUD operations typically take 11 - 12 seconds.
I noticed a few weeks ago Railway initiated an automatic upgrade to Railway "Metal".
Is this upgrade the source of the slow response and how can I resolve?
thanks,
Kel
49 Replies
5 months ago
Railway Metal is Railway's own underlying infrastructure! It is supposed to be faster and more reliable than the old GCP instances.
Could u maybe show us those requests in your HTTP logs?
5 months ago
Can you also make sure that all your services are in the same region and using the Private Network whenever possible?
How do I download the requests in my HTTP logs. I seemed to remember there is some kind of Railway widget that I have to install (?) in Chrome
Looks like it's running on the public network, how do I change to private network
5 months ago
Can you try clicking on that purple thunder icon? That will enable the metal edge network
5 months ago
And let's see if that speed things up for you
5 months ago
When I said private networking I'm talking about the communication between your services (see the docs I linked) and not your public domains!
here's a screen shot from http log showing opening a record is taking 12s
5 months ago
yeah
5 months ago
According to your logs, seems that it is this /idea/ endpoint that is slower than the others, what does it do?
/idea/ is showing a list of 81 records in my database. My database is a postgres database hosted on Railway also
5 months ago
They are not connecting to their database via the private network.
How do I connect the database via the private network? Is it somewhere here…
5 months ago
No! go into your "web" service and reference the private db url in that env var of yours
5 months ago
Should be something like `
5 months ago
See that solid arrow between your services? it means you're referencing the public url, you need to change it to the private url.
Change it from ${{Postgres.DATABASE_PUBLIC_URL}} to ${{Postgres.DATABASE_URL}}
I'm looking at the 22 service variables for the web service, but I do not see a variable for "private db url". I see a variable called DATABASE_URL, is this what you are referring to ?
I'm not clear on what I'm supposed to change? Do I open the DATAURL variable, and change it to : ${{Postgres.DATABASEURL}}
Or do I create a new variable reference called DATATBASEPRIVATEURL and assign ${{Postgres.DATABASE_URL}}to it?
5 months ago
Change the DATABASE_URL to ${{Postgres.DATABASE_URL}}
5 months ago
considering that's the env var you use to connect to the db
When I go to edit the DATABASEURL variable it already shows ${{Postgres.DATABASEURL}} in the field

5 months ago
Then I don't think your app is using this DATABASE_URL env var
You also have a PGHOST,PGDATABASE, PGPASSWORD, PGPORT and PGUSER, your app is probably using these ones
5 months ago
have your application use the url based variable
5 months ago
I'm sorry but I cannot offer coding support, I'll let medim chime in on that.
Brody, can I just rollback the automatic upgrade to Railway "Metal" that was done. Everything was going fine until this automatic upgrade was done. Can I rollback?
5 months ago
We have deprecated the old regions, so you cannot roll back to them. Going forward, you will want a proper configuration for connecting to your database via the private network.
Hmm, so how do I create a proper configuration for connecting to my database via the private network?
5 months ago
I've done it for you, you can check the activy panel to see what i changed.
But now you need to update your source repo because it doesn't exist anymore.
5 months ago
By checking your code!
5 months ago
If it's a public repo I can check it for you
5 months ago
otherwise it's something only you can do
5 months ago
I already did it for them
5 months ago
You need to update your source repo because it doesn't exist anymore.






