API response time

Hello! I am looking for the best place to deploy my API and I currently have the "Pro Plan" package. I currently have the API on Hostgator but I'm looking to improve the deployments and that's why I came across railway.app. I would like to ask a question because I want to optimize my service and improve response time. Currently on this domain (example) https://api.mydomain.com/ I have an end-point "api/v1/oauth", in which my hosting (Hostgator) takes on average 500ms or less to process the response, I attach screenshot. View image #1. I deployed this same code in Railway and I am getting higher response times than in "Hostgator", in all my API end-points, I attach a screenshot of the same test but in "Railway". View image #2. Note: The two projects connect to an external database deployed on planetscale.com. I would really appreciate the guidance, the code is the same, the database for both deployments is the same, but in "Railway" it has higher response times. The package I have contracted with Hostgator is the "Turbo", Could someone give me a suggestion on what I can do to improve response times, I really like Railway but I need to improve response times. Thank you very much !
No description
No description
25 Replies
Percy
Percy15mo ago
Project ID: N/A
Brody
Brody15mo ago
n/a theres 2.5 reasons I can think of, you are far away from railways only current region of us-west1, or railway is far away from the planet scale region, or both
otrujillo.dev
otrujillo.dev15mo ago
I have also tried connecting to a database on Hostinger and the same thing happens, Hostinger still gives me the same low response times and Railway the same high ones, so I think it can't be that.
Brody
Brody15mo ago
if you don't mind me asking, where are you located don't be specific
otrujillo.dev
otrujillo.dev15mo ago
Cancún, México
Brody
Brody15mo ago
and what region is your hostgator database in?
otrujillo.dev
otrujillo.dev15mo ago
Good question, I have not seen what zone the database runs in, it is a standard CPanel account.
Brody
Brody15mo ago
well you can always check via the IP address
otrujillo.dev
otrujillo.dev15mo ago
Florida Jacksonville, USA
Brody
Brody15mo ago
well that's across the country from railways region what is your planetscale region?
otrujillo.dev
otrujillo.dev15mo ago
AWS us-east-1 (N. Virginia)
Brody
Brody15mo ago
and that's still across the country from railways region so yeah I can definitely see that being part of the longer times
otrujillo.dev
otrujillo.dev15mo ago
Do you know if I can change the Railway zone? Do you consider that the longer times are because of the distant areas of the database with the deployment of Railway ?
Brody
Brody15mo ago
not yet, next friday is the eta for regions, the east coast region would be somewhere around new york yeah accessing data thats in a database in the east coast from a datacenter in the west coast would add latency to your app
otrujillo.dev
otrujillo.dev15mo ago
I am in testing stage, I can create again the database in a zone closer to "Railway", which one do you consider the best ? I attach a screenshot.
otrujillo.dev
otrujillo.dev15mo ago
No description
Brody
Brody15mo ago
us-west-2 funnny enough railway runs on gcp and gcp calls their oregon region us-west1
otrujillo.dev
otrujillo.dev15mo ago
Ohh very good, look I have other regions in GCP
No description
otrujillo.dev
otrujillo.dev15mo ago
Do you think it could be one of them?
Brody
Brody15mo ago
railways only region is us-west1
otrujillo.dev
otrujillo.dev15mo ago
Ok, I will do the tests and I will comment how it went, thank you very much !
otrujillo.dev
otrujillo.dev15mo ago
Wow, you were right I did the configurations and set up the database where you told me and now my response time is less than Hostgator's! I attach the screenshot with new response time.
No description
Brody
Brody15mo ago
wow thats a good bit faster eh!
otrujillo.dev
otrujillo.dev15mo ago
Yes it is!, let me buy you a coffee.
Brody
Brody15mo ago
you really dont have to thank you ❤️
Want results from more Discord servers?
Add your server