Horizontal Scaling on Railway Pro Plan
a-bmt02
PROOP

a year 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

a year ago

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


a year ago

Also, take a look at these docs:
https://docs.railway.com/reference/scaling


a year ago

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


a year ago

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


a year ago

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


a year ago

@DEOGEE


a-bmt02
PROOP

a year ago

N/A


a-bmt02
PROOP

a year ago

My bad , i was away for a while


a-bmt02
PROOP

a year ago

Should i open a new thread?


a year ago

nope this thread is good


a-bmt02
PROOP

a year 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

a year ago

I apologize for the basic questions.


a-bmt02
PROOP

a year 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?


a year 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


a year ago

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


a year 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


a year ago

idk if that made sense


a-bmt02
PROOP

a year ago

Thank you , i'll look into these


a year ago

but depends on what you're running


a-bmt02
PROOP

a year 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

a year ago

Thank you so much @Medim


a year ago

Are you using a serverless gpu provider?


a year ago

Railway doesn't have gpus for now™️


a year ago

maybe with metal..


a-bmt02
PROOP

a year ago

Yes i am , runpod.


a year ago

nice


a year ago

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


a year ago


a year 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


a year ago

all replicas will stop / start when downscaling / upscaling.

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


a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...