Learn More

How to Create a Custom Autoscaling Schedule with Judoscale

Judoscale is all about using metrics to automatically determine when to scale up and down. On rare occasions, though, it makes sense to schedule certain scaling needs in advance. A few examples…

  • You want a minimum of two dynos (for redundancy) during the week, but scaling down to a single dyno is okay on the weekends.
  • You want to “pause” scaling overnight when you don’t expect any real usage.
  • You have a weekly newsletter that drives a large, sudden, and predicatable spike of traffic to your app, and you want to “pre-scale” for this event.

You can handle these scenarios by adding a custom autoscaling schedule.

Create your schedule

Without a schedule in place, you’ll see a simple range slider for your “scale range”. To create a schedule, click the “Create Schedule” button.

Create schedule button

Your schedule is a series of “scale ranges” that apply at different times of the week. Judoscale starts you out with a basic weekday/weekend schedule, but it’s merely a suggestion.

Default schedule

Note that those scale ranges are identical, so right now the schedule isn’t really doing anything—the scale range is the same as it was before, all week long.

Customize your schedule

Click on any part of the week to edit that “block”. You can change the day and time for when the block starts, and the scale range that takes effect at that time.

Editing a schedule entry

👀 Note

All times in the schedule are in UTC. This might change in the future.

If you choose to keep the weekday/weekend schedule, you’ll probably want to adjust the times to match when your users’ weeks typically start and end.

But you can do so much more than just weekdays and weekends!

Create a daily schedule

Let’s say you want to allow scaling down more overnight, while keeping a higher minimum scale during the day. Click the plus icon to add a new scale range.

Add a scale range

In this example we’re reducing our scale range to 1-3 dynos at 21:00 UTC every weekday evening. Note that this only handles the evening scale range. You’ll want to add another daily scale range for the morning.

Daily scale ranges

Here I’ve added another scale range for weekdays at 8:00 UTC to scale back up.

The “weekdays” and “everyday” options for creating scale ranges are convenience methods for creating multiple scale ranges at once, but you’ll edit each scale range independently.

Editing a weekday scale range

Delete a scale range

Our weekday/weekend scales are redundant now, so we can delete them. To do that, just click on them and click “Delete” in the edit form.

Delete unwanted scale ranges

We now have a clean schedule that scales up each weekday morning and down each weekday evening. And our weekend is still scaled down thanks to our Friday evening scale event.

Weekend is covered

Delete your entire schedule

If you change your mind and decide you don’t need a schedule after all, you can get back to the basic range slider by deleting all of the scheduled ranges in your calendar. After deleting the final scale range, you’ll see an empty calendar. Just refresh your page to bring back the simple slider.

Pre-scaling with a scheduled scale range

A common scenario is a predictable traffic spike. Let’s say you have a newsletter that goes out every Wednesday at 10:00 UTC, and it brings a huge spike in traffic. Metrics-based autoscaling isn’t quite fast enough to handle the spike, and your users experience a slowdown for a few moments. You want to pre-scale so you’re ready for that traffic spike.

You can handle this by scheduling a constrained scale range just before your expected spike. Let’s say you usually autoscale 2-6 dynos during the day, and you want to be running 6 dynos when the spike hits. You could schedule a range of 6-6 dynos (for a fixed scale) or 6-10 dynos (for an immediate upscale plus metrics-based autoscaling) at 9:55 UTC.

Pre-scale for traffic spike

Note that you probably also want to scale back down after a short while, otherwise you’ll remain at 6-10 dynos until the evening. To do that, just create another scale range at a later time, say 10:30 UTC, and you’ll be good to go.