#Slow outgoing HTTP Requests

28 messages · Page 1 of 1 (latest)

distant abyss
#

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.

pine muskBOT
#

Project ID: b39ed185-6129-4d76-8858-d45b041e6d37

distant abyss
#

b39ed185-6129-4d76-8858-d45b041e6d37

#

The service that makes http requests is chr-listener

cinder nova
#

are we talking about uploading data from local to your app running on railway?

distant abyss
#

Nop, the service itself is struggling with egress http calls.

Calling rest endpoints of external services outside railway.

cinder nova
#

what language?

distant abyss
#

It's a nodejs application, axios.

cinder nova
#

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

distant abyss
#

Yea I mean I thought it was weird as well. But everything runs so smooth locally, I only see the issue on railway.

cinder nova
#

might also be an issue with the base ubuntu images nixpacks uses, you can also try to use an alpine based node 18 dockerfile

distant abyss
#

I could try fetch, I have a .nvmrc with 18.14.0 so I guess it should be quite straight forward.

cinder nova
#

dont think that would get railway to build with node 18

distant abyss
#

I had some issues producing a docker image with my pnpm workspace turborepo.

cinder nova
distant abyss
#

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

cinder nova
#

just asked the team if there is any type of bandwidth management for traffic away from the app, will report back

distant abyss
#

Thanks!

#

Yea this service sends quite a few http calls, so would be good to know

cinder nova
#

got my answer, theres nothing in that layer, no bandwidth management, proxy, etc. nothing

distant abyss
#

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.

cinder nova
#

good luck! but you can keep this ticket 🙂

distant abyss
#

Hey @cinder nova, 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.

cinder nova
#

yeah go try fly with your dockerfile

#

if there's no issues then you got your new host

distant abyss
#

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.