Horizontal Scaler for Railway
Railway doesn't offer first-party support for horizontal scaling.Thus, I have built a workaround for now that allows scaling out to any number of instances. And also supports auto-scaling, where your app scales up under periods of high load, before scaling back down once the traffic slows down. This is an experimental service & horizontal-scaler uses railway's internal API which can break in future. I won't be responsible for that.
-
Open your project, press
Cmd/Ctrl + K
& type inhorizontal-scaler
-
Fill in the required configuration options.
BACKBOARD_TOKEN
can be found in the CLI’s configuration file$HOME/.railway/config.json
.
BACKBOARD_TOKEN
- This can be found in$HOME/.railway/config.json
. Make sure you have installed and are logged into CLI.SERVICE_NAME
- Name of the service that you want to horizontally scale.CPU_MIN
- If your averagedvCPU
usage is below this, services will scale down.CPU_MAX
- If your averagedvCPU
usage is above this, services will scale out.MEMORY_MIN
- If your averagedmemory
usage is below this, services will scale down.MEMORY_MAX
- If your averagedmemory
usage is above this, services will scale out.SERVICE_MIN
- Minimum number of instances that should be load-balanced at any given time, irrespective of the resource usage.SERVICE_MAX
- Maximum number of instances that should be load-balanced at any given time, irrespective of the resource usage.
This is an experimental service & horizontal-scaler uses railway's internal API which can break in future. I won't be responsible for that.