R
Railway

✋|help

API response time

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

Looking for more? Join the community!

Recommended Posts
Added a template as CRON service and it shows "Your project has no deploys"I added this template to take automatic DB backup - https://railway.app/template/UGKaB8 I added a Cservice in only one environment?Is it possible to have certain service(s) only in specific environment? I am making a new cron job tdeploy not building uptried it already three times now canceled teh ones before at around 5 mins the third is currently atError connecting to Redis database.As shown in the picture, I cannot connect to the database. I do not know the reason, but I think thaLove Railway but confused on pricingHello! I’m currently using the free trial of Railway for a service, and I’m loving it. As my free trWhat I thought was a simple python upgrade broke my deployed flask service. Need some help.Project ID: b06af9f3-d9c9-4d4c-a74f-c5521f149984/service/872870dd-f98a-486c-9f14-09fcd5bc43e5Question regarding pausing subscriptionHi there! I’m relatively new to railway, I’ve registered before the pricing change and got verifiedError with discord bot using go and pythonI am new to asking questions in a place like this, so please forgive me if there are any problems ISelenium driver unable to fetch page in Selenium deploymentI am facing an issue while deploying my app via railway.app. 

Here is the description of the app: I up loaded Tesseract-OCR Folder on gitup but on railway cant't findpytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH.How to enable Email on CloudflareI have a React/NodeJS app running on Railway using a custom domain. Cloudflare DNS records have beeUnused DatabaseHey, I have a backend talking to my express server. Both are hosted on Railway. The thing is I am noRun a command in production (rake)Hi there, newcomer from Heroku here — I need to run a command in my production environment (in this don't remember how to log in into my accountI need to access to my account to suspend something, but I faced this notification (in the picture) Run a daily rails rake script on cronHi I have an app that does a daily update to the data in the db. Currently using railway I run this typebot internal server errortypebot is experiencing internal server error. What is the solution?Internal Server ErrorI have this problem, i need helpSpringBoot with MySQL on railway setupHey I am learning SpringBoot and was working locally with a MySQL db set up(locally as well), and I Laravel: failed to build projectHello, I am new to Railway. I am trying to deploy laravel project from my github repo, which is a rePricing questioni got 10 eur in credits because that lowest i could go and got hobby plan 5 eur a month, but after m