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 !
25 Replies
Project ID:
N/A
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
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.
if you don't mind me asking, where are you located
don't be specific
Cancún, México
and what region is your hostgator database in?
Good question, I have not seen what zone the database runs in, it is a standard CPanel account.
well you can always check via the IP address
Florida Jacksonville, USA
well that's across the country from railways region
what is your planetscale region?
AWS us-east-1 (N. Virginia)
and that's still across the country from railways region
so yeah I can definitely see that being part of the longer times
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 ?
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
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.
us-west-2
funnny enough railway runs on gcp and gcp calls their oregon region us-west1
Ohh very good, look I have other regions in GCP
Do you think it could be one of them?
railways only region is us-west1
Ok, I will do the tests and I will comment how it went, thank you very much !
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.
wow thats a good bit faster eh!
Yes it is!, let me buy you a coffee.
you really dont have to
thank you ❤️