Tech Tip #36: Let quiet services scale to zero

Why run a service all night for zero requests?

Video created by explainapaper.com

The problem

Services with bursty or office-hours traffic run at full size around the clock because autoscaling was never set up, or has a minimum of several replicas.

The fix you can use today

  • Add autoscaling matched to demand instead of static provisioning.
  • Use event-driven scaling (for example KEDA) to scale idle workloads to zero.
  • Measure cold-start cost and keep one warm replica only where latency needs it.

Tools that help

  • GreenCode Constitution skill (GreenCode researchers): open-source energy principles and a catalogue of 37 energy anti-patterns that an AI coding agent can follow to find and fix waste like this
  • KEDA: event-driven autoscaling for Kubernetes, including scaling a workload to zero when there is nothing to do
  • Kepler: exports energy estimates per pod and container on Kubernetes, using eBPF and hardware counters

How GreenCode helps

GreenCode helps tackle this by mapping a running estate, including services that barely run at all. It rebuilds the estate as infrastructure as code and attributes energy and CO2e to the services that cause it. More on this.

Tags

#kubernetes#autoscaling#serverless#idle

Sources

All GreenCode Tech Tips

  • Tip #36
  • For Ops and infrastructure
  • Category Containers, Kubernetes and serverless
  • Format short video
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch