Introduction

Getting started with Judoscale on Heroku

Judoscale integrates with Heroku to autoscale your dynos effectively.

There’s a couple of ways to get started: signing-up through judoscale.com directly and choosing “Heroku” for your hosting platform, or installing the Judoscale add-on through the Heroku marketplace. Same product, same features, different pricing. Learn more in our pricing docs.

Setup

This guide will walk you through direct sign-up first, followed by the add-on setup instructions.

Heroku Direct Sign-up

Sign up for a Judoscale account, and select “Heroku” for your hosting platform.

Screenshot: choose your hosting platform in Judoscale

Next, follow the link to “Authenticate with Heroku”, which will redirect you to Heroku to authorize Judoscale to access your teams and autoscale your apps.

Screenshot: Heroku direct authorization

👀 Note

Judoscale integrates with Heroku via OAuth, which grants access to all of your teams and apps (sadly), but after granting access you’ll come back to Judoscale and choose which team(s) and app(s) to link for autoscaling.

After you’ve completed the authorization on Heroku, you should be redirected back to Judoscale, and be presented with a list of your Heroku teams. Select the team you want to link to Judoscale.

Screenshot: Heroku direct teams listing in Judoscale

👀 Note

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

After linking the team to Judoscale, you’ll be presented with the list of applications that belong to that team. Select the first app you want to link to Judoscale.

Screenshot: Heroku direct apps listing in Judoscale

This will add the selected Heroku app as a Judoscale application, automatically linking all the processes within that app, and take you to the team dashboard.

The dashboard is essentially the same regardless of direct sign-up or using the add-on, and so is setting up the processes for autoscaling. Jump to installing the Judoscale package to continue.

👀 Note

You can link additional apps later by clicking “Link another Heroku app” in the team dashboard.

Heroku Add-On

You can provision the Judoscale add-on for your Heroku app via the Heroku CLI with:

heroku addons:create judoscale -a YOUR_APP_NAME

or via the web UI:

Screenshot: provisioning Judoscale add-on via the web UI

Once provisioned by Heroku, launch Judoscale via the CLI or by clicking the link in Heroku’s web UI:

heroku addons:open judoscale -a YOUR_APP_NAME

👀 Note

By default your app will be setup with the free White Belt plan, which includes all autoscaling features and a limited number of autoscales per month. You can install the add-on on multiple Heroku apps, and each app will have its own separate plan and billing. Learn more in our pricing docs.

You should be logged into Judoscale automatically, and land on the team dashboard for your app.

👀 Note

You can set a password on your newly created Judoscale account, to access it later without going through the add-on. If you already had a Judoscale account with the same Heroku email, we’ll be able to match it.

The dashboard is essentially the same regardless of direct sign-up or using the add-on, and so is setting up the processes for autoscaling. Continue to installing the Judoscale package.

Installing the Judoscale package

The team dashboard will show all linked Heroku apps and their respective processes, the number of running dynos, and their autoscaling status within Judoscale. If this is your first time linking an app, none will be autoscaling yet.

Screenshot: Judoscale team dashboard listing Heroku apps and processes

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

Screenshot: Judoscale package installation wizard

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, Judoscale can still autoscale your web dynos using response time, and you can scale on a schedule without installing anything into your application.

If you’re using direct sign-up, you’ll also need to set a JUDOSCALE_URL environment variable in your Heroku app. The add-on is able to set that up automatically for you. This is how the Judoscale package knows where to send metrics and link those metrics to the correct app / process.

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.

Screenshot: scaling charts in Judoscale

👀 Note

If your web process isn’t receiving traffic, or if your worker process 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 process, 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 processes, but you’ll want to customize your “Dynos” range based on how high and low you’re comfortable scaling.

Screenshot: Judoscale configuration

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 dyno running under light load, while others always want multiple dynos 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 process up until the max dynos is reached.

👀 Note

Judoscale cannot see whether you’re using Heroku’s native autoscaling feature, available only to performance/private/shield dynos. You should disable it before enabling autoscaling in Judoscale. Using multiple autoscalers on the same process will cause unpredictable scaling.

Scroll down and click “Save and enable autoscaling”, and that’s it! For a full tour of the available charts and configuration options, check scaling configuration.

🚨 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!