Do you really need to scale to zero?
In the FaaS space, there has been a big push to allow the ability to scale down to no workload running. I want to ask: Is this something you actually want or need?
Scaling to zero allows containers to be run only when there is demand. For certain workloads, this gives a lot lower baseline resource usage and lets you scale down instances when in the public cloud to cost less.
This sounds pretty nice, right?
One of the common problems with FaaS solutions is the latency of spinning up a new instance to handle the request. There are several solutions to this problem that I’ve seen but they require already running at least a few containers to give a “warm-start”.
With the autoscaling that a good PaaS solution can provide, we can scale to one and let it be good. This has the drawback of a higher baseline utilization and cost. Done right, with smart scheduling and workload placement, this should be marginal as this single instance can probably fill in otherwise underutilized resources (See my previous post: How big is a Container, Really?)
I’d even argue that, for many uses, Cloud Foundry can get you a FaaS-like developer experience. If you add your framework logic into the buildpack so that the application code is simply an exported function handler. (I promise an technical blog about FaaS vs PaaS soon!)
There are obviously workloads where scaling to zero can be very useful. These are found where latency is not important, and demand is unpredictable. It’s a good way to have availability and reliability without the overhead cost.
As with everything, it’s all about understanding what tradeoffs are being made and their associated costs. Scale to zero is a very nice tool to have for the appropriate workloads as well as a source of some good ideas that the industry needs to pay attention to. That said, for a lot of your existing application development, a good PaaS is likey all you need.
NOTE: Incidentally, as I was writing this post, Kelsey Hightower posted the same question on Twitter.
Related Articles
Apr 21st, 2023
No comments yet