Getting started with Judoscale on Railway

Judoscale integrates with Railway to autoscale your deployments. Sign up for a Judoscale account, and select “Railway” for your hosting platform.

Screenshot: choose your hosting platform in Judoscale

Next, follow the link to the Railway account settings to generate a team token and connect your team to Judoscale.

Screenshot: team creation page for Railway in Judoscale

👀 Note

Judoscale needs your Team Token in order to fetch project environments and services information, and update the number of running replicas. Your services are not affected until you explicitly enable autoscaling.

In your Railway account settings, create a new Team token and name it “Judoscale” (you can name it anything you want). Make sure you select the correct Team you want to connect to Judoscale. Account tokens, which are not tied to a team, are not supported.

Screenshot: create a Team token in Railway

Paste your Team token into Judoscale, and click “Connect to Railway”.

👀 Note

You can connect additional teams later by clicking “Add team” in the Judoscale dashboard sidebar.

After connecting the team to Judoscale, you’ll be presented with the list of projects + environments that belong to that team. Select the first project environment you want to link to Judoscale.

Screenshot: Railway team projects + environments listing in Judoscale

This will add the selected Railway project environment as a Judoscale application, automatically linking all the services within that environment, and take you to the team dashboard.

Screenshot: Judoscale team dashboard listing Railway services

Here you’ll see all of your linked Railway project environments and their respective services, the number of running instances, and their autoscaling status within Judoscale. If this is your first time linking an environment, none will be autoscaling yet.

👀 Note

You can link additional project environments later by clicking “Link another Railway project environment” in the team dashboard.

Installing the adapter

In the Judoscale team dashboard, click the service you want to autoscale. This takes you to the Scaling page, where you’ll be prompted to complete the setup for that service.

Screenshot: Judoscale adapter installation wizard

Choose your stack information, and follow the instructions to install the adapter specific to your stack. The adapter is how Judoscale collects queue metrics from your application, similar to a lightweight APM tool. Check the web frameworks and job backends we currently support here.

You’ll also need to set a JUDOSCALE_URL environment variable in your Railway project environment or service settings. This is how the Judoscale adapter knows where to send metrics and link those metrics to the correct service.

Once you’ve installed the adapter and deployed your application, click “Finished and Deployed” to complete the setup. Judoscale will begin showing your queue metrics in the Scaling page charts.

Screenshot: scaling charts in Judoscale

If your web service isn’t receiving traffic, or if your worker service has no jobs waiting in queue, you won’t see any activity in the charts. Let it collect metrics while your app is under load to see queue time information.

Configuring and enabling autoscaling

Now that Judoscale is monitoring your service, you’re ready to autoscale!

Scroll down the Scaling page to review your autoscale settings. The default settings are usually a good starting point for most services, but you’ll want to customize your “Instances” range based on how high and low you’re comfortable scaling.

Screenshot: Judoscale configuration

There’s no “correct” range here. Judoscale defaults to one instance as the minimum, but some teams always want multiple instances running even under light load, so they’ll set the minimum instances to two or higher. The maximum is really about limiting costs. Remember that under heavy load (high queue times), Judoscale will continue scaling your service up until the max instances is reached.

Scroll down and click “Save and enable autoscaling”, and that’s it!

🚨 Warning

If anything in these docs doesn’t work quite right or you have questions, know that you can always reach out to us at [email protected]. Your email goes directly to the Judoscale devs!