DB so much slower after changing to metal
stefanflorea00
PROOP

a year ago

Hi,

We have a database that was working fine, no issues.

The database was migrated to railway metal, since then we are having issues connecting to it.

There were no changes in our code, and the timing matches with the migration.

We tried restarting, redeploying, going back to pre-metal is not supported.

Running the code locally on a local database, with the exact same code works just fine.

We use prisma for db connection.

It seems the table is getting updated, however it's extremely slower

Updating previously ~1000 rows was almost instant,

Now it takes over 10 minutes.

We are based in EU-west, we had it in EU-west before, now it's was changed to US, but that shouldn't affect the time that much, right?

Could this be on railway's end?

Solved

8 Replies

parmstar
EMPLOYEE

a year ago

I would definitely move all of these into the same region as a start - latency could be a big part of the problem.

You have the DB in EU Metal. But one of your shopify services is in EU Cloud. And the other is in EU Metal.

Can you put all these services in the same region and then see how it looks?


Status changed to Awaiting User Response Railway 11 months ago


pitops
HOBBY

a year ago

I have the same issue. Trying to run some migrations (50-60k records), while it takes 1-2 minutes locally, on railway it doesn't even finsih and its extremely slow adding the batches. Postgres is in EU metal. Queries are fasts, writes are extremely slow for the migration script at least. There is definitely an issue that needs to be investigated


Status changed to Awaiting Railway Response Railway 11 months ago


parmstar

I would definitely move all of these into the same region as a start - latency could be a big part of the problem.You have the DB in EU Metal. But one of your shopify services is in EU Cloud. And the other is in EU Metal. Can you put all these services in the same region and then see how it looks?

stefanflorea00
PROOP

a year ago

No, the DB was put in US metal, it's not possible to move it to EU, we would rather not move every other services to US to test this

I don't believe that region could affect latency as much as to turn 200ms in 10 seconds


parmstar
EMPLOYEE

a year ago

Alright thanks - escalating internally to see if we find anything


Status changed to Awaiting User Response Railway 11 months ago


stefanflorea00

No, the DB was put in US metal, it's not possible to move it to EU, we would rather not move every other services to US to test thisI don't believe that region could affect latency as much as to turn 200ms in 10 seconds

parmstar
EMPLOYEE

a year ago

No, the DB was put in US metal, it's not possible to move it to EU, we would rather not move every other services to US to test this

May i have your permission to move this to EU metal?


parmstar

No, the DB was put in US metal, it's not possible to move it to EU, we would rather not move every other services to US to test thisMay i have your permission to move this to EU metal?

stefanflorea00
PROOP

a year ago

Yess please do


Status changed to Awaiting Railway Response Railway 11 months ago


stefanflorea00

Yess please do

parmstar
EMPLOYEE

a year ago

All done! Let me know how it goes now.


Status changed to Awaiting User Response Railway 11 months ago


parmstar

All done! Let me know how it goes now.

stefanflorea00
PROOP

a year ago

That fixed it, thank you!

Now something that took ~15mins is back to ~30s


Status changed to Awaiting Railway Response Railway 11 months ago


Status changed to Solved chandrika 11 months ago


Loading...