Tech Tip #46: Do containers waste energy?

Containers add a small energy tax. Consolidation pays it back.

Video created by explainapaper.com

The problem

Some teams avoid containers fearing overhead. Measurements show Docker adds slightly more energy than bare metal, mostly from I/O virtualisation, but packing workloads onto fewer machines usually outweighs it.

The fix you can use today

  • Consolidate containers onto fewer, busier nodes.
  • Avoid unnecessary layers of virtualisation (containers inside VMs inside VMs).
  • Shut down nodes the bin-packing frees up.

A study found that Docker adds only a little energy compared with running on the bare machine. GreenCode's research review draws on this work.

Tools that help

  • Kepler: exports energy estimates per pod and container on Kubernetes, using eBPF and hardware counters
  • Scaphandre: measures the power drawn by each process on a Linux server and exports it to Prometheus and other monitoring stacks

How GreenCode helps

GreenCode helps tackle this by mining a running estate, rebuilding it as infrastructure as code and tracing energy and CO2e to the services that cause it, including services barely running at all. More on this.

Tags

#docker#kubernetes#right-sizing

Sources

Transcript

Containers add a small energy tax. Packing them tightly pays it back. Myth or fact: containers waste energy? Mostly myth. Some teams avoid containers because they fear the overhead. Measurements show Docker uses slightly more energy than the bare machine. Most of that extra comes from handling input and output. But packing work onto fewer machines usually more than makes up for it. Here is the fix you can use today. Pack your containers onto fewer, busier machines. Tools like Kepler and Scaphandre show the energy each container and process uses. Avoid stacking layers, like containers inside virtual machines inside virtual machines. Then shut down the machines you freed up. The overhead per container is small. The saving from switching off whole machines is large. A study found Docker adds only a little energy compared with the bare machine. GreenCode's research review draws on this work. GreenCode helps tackle this by tracing energy to the services that cause it. It rebuilds your running estate as code, and flags services barely running at all. That was GreenCode Tech Tip number forty-six. Follow for the next tip, and find more on greencode.ai/tech-tips.

All GreenCode Tech Tips · All GreenCode videos

  • Tip #46
  • For Ops and infrastructure
  • Length 1:17
  • Category Containers, Kubernetes and serverless
GreenCode

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

Get in touch