R
Railwayβ€’2y ago
snieking

Slow outgoing HTTP Requests

Hi, I am experienced issues with really slow outgoing HTTP requests. If I run my application locally everything works well and is fast. But the app on railway really struggles and I've had to increase the HTTP request timeout to 10 seconds. Sometimes things go through fast, but very often I get timeouts.
23 Replies
Percy
Percyβ€’2y ago
Project ID: b39ed185-6129-4d76-8858-d45b041e6d37
snieking
sniekingOPβ€’2y ago
b39ed185-6129-4d76-8858-d45b041e6d37 The service that makes http requests is chr-listener
Brody
Brodyβ€’2y ago
are we talking about uploading data from local to your app running on railway?
snieking
sniekingOPβ€’2y ago
Nop, the service itself is struggling with egress http calls. Calling rest endpoints of external services outside railway.
Brody
Brodyβ€’2y ago
what language?
snieking
sniekingOPβ€’2y ago
It's a nodejs application, axios.
Brody
Brodyβ€’2y ago
thats very odd, ive never had any issues with making api calls to external services, maybe this is a bug with axios? might wanna try switching to the fetch api that comes std with node 18
snieking
sniekingOPβ€’2y ago
Yea I mean I thought it was weird as well. But everything runs so smooth locally, I only see the issue on railway.
Brody
Brodyβ€’2y ago
might also be an issue with the base ubuntu images nixpacks uses, you can also try to use an alpine based node 18 dockerfile
snieking
sniekingOPβ€’2y ago
I could try fetch, I have a .nvmrc with 18.14.0 so I guess it should be quite straight forward.
Brody
Brodyβ€’2y ago
dont think that would get railway to build with node 18
snieking
sniekingOPβ€’2y ago
I had some issues producing a docker image with my pnpm workspace turborepo.
snieking
sniekingOPβ€’2y ago
cool, I will try that then and check if that resolves the issue. Next step after that would be to try to docker again I suppose
Brody
Brodyβ€’2y ago
just asked the team if there is any type of bandwidth management for traffic away from the app, will report back
snieking
sniekingOPβ€’2y ago
Thanks! Yea this service sends quite a few http calls, so would be good to know
Brody
Brodyβ€’2y ago
got my answer, theres nothing in that layer, no bandwidth management, proxy, etc. nothing
snieking
sniekingOPβ€’2y ago
okey, good to know thanks. I'll experiment a bit more with my side. I'll open a fresh ticket if I still struggle after trying both things.
Brody
Brodyβ€’2y ago
good luck! but you can keep this ticket πŸ™‚
snieking
sniekingOPβ€’2y ago
Hey @Brody, I tried first new node fetch with node18 and it was the same issue. I now converted it to a Docker service with node:18-alpine, but still the same issue. I am not sure what to test next, probably I have to try to run the container in a separate cloud service, if its the same there then we at least know its not something related to railway.
Brody
Brodyβ€’2y ago
yeah go try fly with your dockerfile if there's no issues then you got your new host
snieking
sniekingOPβ€’2y ago
Well good and bad news. Same issue in Heroku with same Dockerfile. So it should be something in the application. πŸ™‚ At least I know where to continue dig now.
Brody
Brodyβ€’2y ago
yay it's not railway
Want results from more Discord servers?
Add your server