Introduction
Getting started with Judoscale on Scalingo
Judoscale integrates with Scalingo to autoscale your containers. This includes autoscaling background workers, like Sidekiq, via queue time rather than CPU or RAM. Sign up for a Judoscale account, and select “Scalingo” for your hosting platform.
Next, follow the link to your Scalingo account to create an API token and connect your project to Judoscale.
👀 Note
Judoscale needs your API token in order to fetch your applications and container information, and update the number of running containers. Your Scalingo containers are not affected until you explicitly enable autoscaling.
In your Scalingo account tokens page, create a new token and name it “Judoscale” (you can name it anything you want). See Scalingo’s API authentication docs for more detail. Copy the token right away—Scalingo only shows it once.
Paste your token into Judoscale, and click “Connect to Scalingo”.
After connecting, you’ll be presented with the list of projects that belong to your Scalingo account, across all regions. Select the first project you want to link to Judoscale.
👀 Note
Scalingo organizes applications under projects, so a Scalingo project becomes a Judoscale team. Projects without any applications can’t be linked. Learn more about Scalingo projects.
You can connect additional projects later by clicking “Add team” in the Judoscale dashboard sidebar.
Linking a project creates a Judoscale team and lists its applications—select one to link. Judoscale automatically links that application’s container types and takes you to the team dashboard.
Here you’ll see all of your linked Scalingo applications and their respective container types, the number of running containers, and their autoscaling status within Judoscale. If this is your first time linking an application, none will be autoscaling yet.
👀 Note
You can link additional applications later by clicking “Link another Scalingo application” in the team dashboard.
Installing the Judoscale package
In the Judoscale team dashboard, click the container type you want to autoscale. This takes you to the Scaling page, where you’ll be prompted to complete the setup for that container type.
Choose your stack information, and follow the instructions to install the package specific to your stack. The adapter package is how Judoscale collects metrics from your application, similar to a lightweight APM tool. Check the web frameworks and job backends we currently support here.
👀 Note
If there’s no adapter for your language / framework, you can still scale on a schedule without installing anything into your application, or build a custom adapter to report queue time metrics yourself.
Once you’ve selected your stack, Judoscale walks you through adding the package and setting the JUDOSCALE_URL environment variable.
The JUDOSCALE_URL environment variable is how the Judoscale package knows where to send metrics and link those metrics to the correct application. Add it to your Scalingo application’s environment—either from the Scalingo dashboard (your app → Environment → Add variable) or via the Scalingo CLI.
scalingo --app your-app-name env-set JUDOSCALE_URL="https://adapter.judoscale.com/api/..."
scalingo --app your-app-name restart
👀 Note
Scalingo does not automatically restart your application when you create, update, or delete environment variables—you need to restart yourself once your changes are in place. See Scalingo’s environment variables API docs. Restart from the dashboard or with scalingo restart; it is a zero-downtime operation that boots new containers with the updated environment before stopping the old ones.
Once you’ve installed the package and deployed your application, click “Finished and Deployed” to complete the setup. Judoscale will begin showing your queue metrics in the Scaling page charts.
👀 Note
If your web container isn’t receiving traffic, or if your worker container 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 container, 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 container types, but you’ll want to customize your “Containers” range based on how high and low you’re comfortable scaling.
There’s no “correct” range here. Judoscale defaults to the initial scale as the minimum, to avoid downscaling as soon as autoscaling is enabled. Some teams are okay with having a single container running under light load, while others always want multiple containers running, and they’ll set the minimum to two or higher. The maximum is really about limiting costs. Remember that under heavy load (high queue times), Judoscale will continue scaling your container type up until the max containers is reached.
Scroll down and click “Save and enable autoscaling”, and that’s it!
🚨 Warning
Judoscale cannot see whether you’re using Scalingo’s native container autoscaling. You should disable it before enabling autoscaling in Judoscale. Using multiple autoscalers on the same container type will cause unpredictable scaling.
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!