Horizontal Scaling on Railway Pro Plan
a-bmt02
PROOP

2 years ago

I have been using the Pro Plan for a while now and i want to implement Horzontal scaling , because when i have too many users sending a request to the railway server , it crashes instead of creating a new instance. Is ther a way I can implement auto instance creation or what is usually the standard solution to this issue?

Solved

31 Replies

2 years ago

Could u reply with N/A so the thread doesn't get closed?


2 years ago

Also, take a look at these docs:

https://docs.railway.com/reference/scaling


2 years ago

as far as I know there's no "auto instance creation" (auto horizontal scaling)


2 years ago

But I think I've seen some users implement some strategy to programatically deploy replicas using the graphql endpoint


2 years ago

cc @Brody (user doesn't have the pro plan cargo)


2 years ago

@DEOGEE


a-bmt02
PROOP

2 years ago

N/A


a-bmt02
PROOP

2 years ago

My bad , i was away for a while


a-bmt02
PROOP

2 years ago

Should i open a new thread?


2 years ago

nope this thread is good


a-bmt02
PROOP

2 years ago

I'll look into graphql thanks. Is this the industry standard of solving this issue or am i approching it wrong?


a-bmt02
PROOP

2 years ago

I apologize for the basic questions.


a-bmt02
PROOP

2 years ago

One more thing , If i have 2 users using one railway replica VS 2 users using 2 seprate replicas , how does the cost compare?


2 years ago

I'm not a well versed devops guy, but I know you can setup auto scaling on services like GCP, AWS and Kubernetes but I don't think i've saw something like this on other PaaS like Fly, Render or Railway


2 years ago

That depends entirely on the resource usage of your service (since that's what railway charges you)


2 years ago

you can have a 3x Go server replicas that run in a idle of 20mb each and don't increase that much on higher loads or 1x ExpressJS server that has an idle of 120mb and goes to ~200mb on high load, you'll get billed for the resource they use


2 years ago

idk if that made sense


a-bmt02
PROOP

2 years ago

Thank you , i'll look into these


2 years ago

but depends on what you're running


a-bmt02
PROOP

2 years ago

It's an ffmpeg server that converts images to video for my startup. It's pretty gpu intensive. I guess i'll try both and compare the results.


a-bmt02
PROOP

2 years ago

Thank you so much @Medim


2 years ago

Are you using a serverless gpu provider?


2 years ago

Railway doesn't have gpus for now™️


2 years ago

maybe with metal..


a-bmt02
PROOP

2 years ago

Yes i am , runpod.


2 years ago

nice


2 years ago

Railway doesn't support auto horizontal scaling based on demand/usage (I'd really like this though)


2 years ago


2 years ago

If you desperately wanted auto-scaling, you'd likely have to create an app that consumes signals (requests/usage) & shoots out scale requests to the railway API. But (I think, unsure) that would cause all instances to restart


2 years ago

all replicas will stop / start when downscaling / upscaling.

best just to set a fixed amount of replicas, enough to handle your expected peak.


2 years ago

!s


Status changed to Solved brody over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...