Full Self-Driving for Web Processes
Full Self-Driving (FSD) is a new way to autoscale web processes. Instead of picking queue time thresholds and sensitivity settings, you pick a scale range and a priority. Judoscale learns how your app behaves under real traffic and decides how many instances (dynos on Heroku) you need from moment to moment.
👀 Note
FSD is in early access, and we’re still tuning the algorithm based on what we learn from real apps. The details below describe the general approach, not exact numbers, which will keep changing. If you’d like to try it, or have feedback, let us know.
How FSD works
FSD replaces manual, static configuration with a fully autonomous learning loop. It continuously learns four things about your app.
Load: how much work is in flight
FSD measures load as the number of requests your instances are working on at the same time.
Load measures the work itself, not how busy each instance is, so it stays the same no matter how many instances share it. That lets FSD compare the load on your whole process with how much one instance can handle.
Normal queue time: what healthy looks like
When an instance has spare capacity, requests barely wait before your app starts on them. That typical queue time is different for every app, often a few milliseconds, depending on your platform and web server. FSD learns what it is for your app from its calmest stretches of traffic, and treats queue time well above it as a sign that an instance is under strain.
Strain point: how much one instance can handle
FSD compares the load each instance carries with its queue time. At lower loads, queue time stays near normal. Past some load, it starts to climb and soon gets much worse. The load where that happens is the strain point: how much work one instance can carry before requests start waiting.
Because FSD learns the strain point continuously from real traffic, it adapts when your app changes. A deploy that makes requests slower or faster, or a change to your instance size or web server concurrency, is reflected in what it learns.
Surges: how quickly your traffic can jump
Some apps see steady traffic, while others get sudden spikes from a marketing email, a batch of API calls, or a busy hour starting. FSD watches for surges, when load rises quickly above where it had been, and remembers how big your recent surges were. That tells it how much extra traffic could arrive before new instances are ready to help.
Putting it together
Every 10 seconds, FSD divides the current load by the strain point to get the number of instances you need, then adds some spare room. For example, if one instance handles about 0.5 requests in flight before it strains and your app has 3 requests in flight right now, FSD wants 6 instances.
The spare room comes from your recent surges. New instances take time to boot and start helping, so the instances already running have to absorb the start of the next surge. FSD keeps enough of them to do that, and the priority setting controls how much spare room it keeps.
From there:
- Scaling up happens right away, and can add several instances in one step when load jumps.
- Scaling down is gradual. FSD removes one instance at a time, and only after load has stayed low enough for a while, so a brief lull doesn’t remove capacity you’ll need a minute later.
- It learns as it goes. If most instances stay strained while FSD thinks it has enough, it lowers its estimate of the strain point and adds an instance.
- It handles one slow instance separately. When a single instance is slow while the rest are fine, adding instances doesn’t fix it. FSD stops counting that instance as capacity and adds one to cover for it. On platforms where Judoscale can restart individual instances, it also restarts that instance, like Dyno Sniper.
FSD always stays within your scale range, including any schedule you’ve set up.
Before FSD knows your strain point
FSD can only find the strain point from traffic that strained your instances. If your process has been comfortably overprovisioned, it hasn’t seen that yet. In that case, FSD gradually trims instances, one at a time, until queue time starts to rise, and adds capacity back as soon as it does. Once it has found the strain point, it scales from that.
Your minimum scale is a floor for this search, so set it to the fewest instances you’re comfortable running.
Requirements
FSD needs queue time from a Judoscale adapter package. If your process isn’t reporting it, the Full Self-Driving button is disabled, and hovering over it explains why. Use “Configure Metrics” to set up the adapter, or update it to its latest version.
Turn on Full Self-Driving
Open your web process in Judoscale. If FSD is enabled for your team, you’ll see a Full Self-Driving button next to “Configure Metrics” in the Autoscale Trigger section.
Click it to see what FSD will do for this process, then click Turn On Full Self-Driving.
Your existing autoscale settings are saved, not deleted. While FSD is on, the threshold and sensitivity settings are hidden, and FSD ignores them.
When you turn it on, FSD immediately learns from the metrics your process has already reported, so it can start making decisions shortly after. Like any autoscaling in Judoscale, it only scales your process while autoscaling is enabled for it.
Choose your priority
With FSD on, the Autoscale Trigger section is replaced by a single Priority setting.
Priority trades cost against headroom:
- Lowest cost keeps little spare room for surges and lets each instance run closer to its limit. You’ll run fewer instances, and requests may wait a bit longer during sudden spikes.
- Most headroom keeps more spare room and sets a more cautious strain point. You’ll run more instances, and sudden spikes are less likely to cause slowdowns.
- Balanced sits in the middle, and is where we recommend starting.
Changing the priority takes effect right away.
Turn off Full Self-Driving
Click the Full Self-Driving button again, then click Turn Off FSD. Your previous autoscale settings come back exactly as you left them.