# Reducing scaling costs with Betterscaling

DevFeed: [Reducing scaling costs with Betterscaling](<https://devfeed.tech/articles/reducing-scaling-costs-with-betterscaling-31924.md>)

Original publisher: [Read original article](<http://engineering.remind.com/betterscaling/>)

Author: Remind

Published: 2022-06-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Remind](<https://devfeed.tech/sources/remind.md>)

Topics: [autoscaling](<https://devfeed.tech/topics/autoscaling.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [API](<https://devfeed.tech/topics/api.md>), [servers](<https://devfeed.tech/topics/servers.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [autoscaling](<https://devfeed.tech/tags/autoscaling.md>), [aws](<https://devfeed.tech/tags/aws.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [infrastructure](<https://devfeed.tech/tags/infrastructure.md>), [optimize](<https://devfeed.tech/tags/optimize.md>)

## AI overview

Remind developed Betterscaling, a lightweight autoscaling tool for its largest cluster, after finding that AWS autoscaling left 20-30% of CPUs provisioned but unreserved. Betterscaling queries the ECS API based on running tasks and adjusts ASG capacity; Remind reports that average unreserved CPU fell from 30% to around 15%.

## Source excerpt

Betterscaling was designed and implemented by Phil Frost. Phil was an exceptional engineer and a brilliant person, and he is dearly missed by all of us at Remind who knew him. I had the privilege of interviewing Phil extensively about Betterscaling over the course of writing this article -- much of it is in his own words. I hope that it will serve in some small way to reflect his expertise and dedication to his craft, and to stand as a tribute to his memory. More students, teachers, and parents are relying on Remind's free messaging features than ever, and although Remind is free for the majority of its users, serving those users still incurs costs. To keep Remind accessible to everyone, we're constantly working to optimize our infrastructure in order to reduce unnecessary overhead. As we dove into the data on our operating costs, we found that overprovisioned resources were a significant cost driver that was ripe for optimization. Specifically, in summer and fall of 2020, on average 20-30 percent of the CPUs in our cluster were provisioned but unreserved -- processing power we were paying for, but not using. Percentage of unreserved CPU before and after Betterscaling (implemented in mid-October 2020) Remind relies on AWS for our server infrastructure, and we found that this overprovisioning was mostly a result of inefficiencies in AWS autoscaling. This by no means an indictment of AWS autoscaling in general -- we simply found that it wasn't ideal for our use case, for reasons I'll discuss in more detail below. Instead, we developed a simple, lightweight autoscaling tool we're calling Betterscaling. In a nutshell, Betterscaling evaluates a control loop which queries the ECS API to determine how big the cluster needs to be based on the tasks running in it, then manipulates the DesiredCapacity on an ASG to make the cluster that big. This article discusses how and why we decided to implement Betterscaling, and then dives into the mechanics of the system itself. We now rel