Faster response times?

So I'm really beginner when it comes to infra and stuff like this so I might not explain things that great. I deployed some services for an app i deployed (mainly just my server and some jobs) and they work good! I saw that these services by default are hosted in the west (im on the east coast) so while response times are fast i feel like they could be better if there was some sort of way I could get it closer. I saw that railway regions was a thing but I just want to see if there were other options before spending more money. Anyone have any tips if you were in my shoes?
21 Replies
Percy
Percy•8mo ago
Project ID: f0e06b4d-4d9e-4d8d-a668-01321847d526
BigBellyBigDreams
BigBellyBigDreams•8mo ago
f0e06b4d-4d9e-4d8d-a668-01321847d526
Fragly
Fragly•8mo ago
Unfortunately there's no way to physically move servers to another region unless you're on pro plan perhaps there are ways to optimize it but I think if response time really matters to you, it's better to just invest into pro plan
BigBellyBigDreams
BigBellyBigDreams•8mo ago
okay so i'm totally fine with upgrading
Brody
Brody•8mo ago
but do tell us about what you've deployed, maybe we have some suggestions and tell us what current times you are seeing
BigBellyBigDreams
BigBellyBigDreams•8mo ago
i haven't done any metrics yet, I just got everything up and running but I can come back with an update afterwards. My server is a monolithic node app and the other services are just scheduled cron jobs running some db queries (i dont really care ab these tbh since it has virtually no impact on the user) i also have a pg db its reading from on railway
Brody
Brody•8mo ago
just give us a simple number, making an api call, what kind of round trip times are you seeing?
BigBellyBigDreams
BigBellyBigDreams•8mo ago
oh okay for sure! give me one sec @Brody on a cold start to load one of my endpoints was about 2 seconds and after a couple runs it was averaging around a second
Brody
Brody•8mo ago
this is an api call that does a database query?
BigBellyBigDreams
BigBellyBigDreams•8mo ago
yeah; you know what let me try to modify it just to see what the round trip time is without any external factors maybe that will be a better indicator just in case it's something i can fix with optimization although rn i barely have any data so i don't think its going to make a huge difference
Brody
Brody•8mo ago
I don't know how big the query was in this api call, but 1 second after cache seems to be a long time even for east to west coast
BigBellyBigDreams
BigBellyBigDreams•8mo ago
oh okay nevermind im not sure if its a simulator thing but i just tested it on my phone and it went down to about 120 ms im not sure why its so slow in the xcode simulator
Brody
Brody•8mo ago
well that's great, 120ms is very good imo
BigBellyBigDreams
BigBellyBigDreams•8mo ago
especially from west to east lol im guessing hahaha, in the future though if i wanted to do something like load balancing does railway have some support for this or would i have to use some external service?
Brody
Brody•8mo ago
railway doesn't currently have global load balancing where you could route incoming requests to the closest region, if that's what you're asking?
BigBellyBigDreams
BigBellyBigDreams•8mo ago
yeah thats what im asking so if i upgraded i would be able to specify the region i want to run it on but can't go much further than that?
Brody
Brody•8mo ago
correct, you can only specify a single region per service, multiple regions per service (with edge routing) is 100% a planned feature and Railway will absolutely be able to do that at some point
BigBellyBigDreams
BigBellyBigDreams•8mo ago
that sounds awesome, definetely looking forward to that when it's released!
Brody
Brody•8mo ago
though if you want this right now, you would need to run multiple clone services yourself in the regions you want and use cloudflare in front to geo load balance them in the future, you will just be able to select what regions you want to run your service in and then railways edge router will route users to the closest service
BigBellyBigDreams
BigBellyBigDreams•8mo ago
ohh okay i see, thanks for all the help!
Brody
Brody•8mo ago
no problem 🙂