5 Ways Slim Containers Save You Money

Do slim containers really save you money on your cloud bill? Are there cost advantages to smaller containers? Find out here.
Chris Tozzi
Nov 28, 2022

Photo by Ibrahim Rifath on Unsplash

Developers can talk all day about how "slim" containers – meaning those that contain only the essential components necessary to power a given workload, with no added cruft – can deliver technical benefits like improved application performance, faster deployment, and simpler development operations.

But to the rest of the business, these benefits aren't that important. What matters to most stakeholders outside of the development and IT departments is saving money.

Fortunately for technical teams trying to convince their colleagues of the benefits of slim containers, there's a strong argument to be made for slim containers on the money front, too. In a variety of ways, lightweight containers contribute to lower hosting bills, which in turn means a fatter bottom line.

To prove the point, let's walk through the cost benefits of slim containers by discussing five specific ways that they save money.

Lighter Resource Consumption Leads to Denser Hosting

Probably the most obvious cost advantage of slim containers is that they consume fewer resources at runtime because there is less running inside them. That translates to greater hosting density, meaning you can fit more containers on a single node.

This saves you money because you don't need to pay for as many nodes, or you can choose less expensive nodes with lower memory and CPU allocations. With conventional containers, you end up paying for more nodes (or more expensive nodes) to host the same workload because your containers waste node resources running processes that aren't actually necessary for your workload.

Faster Startup Enables Greater Scalability

The fewer resources you have running in each container, the faster the containers will start, in most cases, because there are fewer processes to initialize. There's also a lower risk of your containers failing to reach the running stage altogether due to a bug or configuration issue somewhere inside the image.

How does this save money, you ask? Well, because faster, more reliable container startup means that your application can scale more quickly because you can launch additional instances of your containers more rapidly. And scalability saves money on cloud hosting because when you can scale quickly, you can get away with provisioning fewer nodes to form your "baseline" environment and rely on autoscaling to provide additional hosting resources when there is an uptick in demand. In other words, you don't need to keep as many spare nodes and container instances on hand just in case there is a sudden uptick in load.

This is harder to do with applications hosted using "bloated" containers that can't start as quickly because you may not be able to scale up those applications in fractions of a second.

Less Bandwidth Consumption and Lower Egress Costs

Bandwidth costs money, especially in cloud environments that stick you with egress bills whenever you move data out of them. One way to end up with high egress costs – not to mention a higher bill from your ISP – is to pull lots of heavyweight container images from a cloud registry into an environment hosted in a different cloud.

Slim containers save money in this respect because the images for slim containers tend to be much smaller than those for conventional containers. For example, full-scale Ubuntu container images weigh in at nearly 200 megabytes each. In contrast, a pared-down, slim version of those containers that contains only the specific libraries and binaries necessary to host a particular workload could end up being around a megabyte in size – meaning the slim alternative will reduce your bandwidth consumption and egress costs by something like a factor of 200.

Lower Storage Costs

By a similar token, slim containers can reduce your storage bill. Cloud-based registries (like Amazon ECR) use cloud storage services (like AWS S3) to store container images, so the larger the images are, the more you'll pay for storage hosting. And even if you run your own registry on private infrastructure, you have to pay for storage infrastructure to support a registry.

Here again, given that slim container images can be hundreds of times smaller than conventional images, they can dramatically reduce storage costs.

Faster Image Scanning Means More Efficient Development

Lightweight container images lend themselves to faster scanning because there are fewer components to scan.

Admittedly, this may not translate to huge direct cost savings, because container image scanning tools are generally not that expensive (in fact, many are available for free within CI/CD tools). But complicated scanning processes can lead to high indirect costs if they result in a large number of vulnerabilities that your developers have to spend time fixing.

Thus, by using slim containers, teams reduce the number of vulnerabilities that are likely to exist inside container images in the first place, which means they can make better use of their development resources.

Conclusion

The benefits of slim container images aren't limited to technical advantages like faster startup and better application performance. They also extend to cost savings in the form of denser servers, lower egress bills, less storage consumption, and more. And those are benefits that even the least technical stakeholders can love.

Bio

Chris Tozzi has worked as a Linux systems administrator and freelance writer with more than ten years of experience covering the tech industry, especially open source, DevOps, cloud native and security. He also teaches courses on the history and culture of technology at a major university in upstate New York.

Related Articles

5 Most Commonly Asked DockerSlim Questions

We enlisted DockerSlim expert and Slim.AI Developer Experience Engineer to dive into how container slimming works.

Primož Ajdišek

Technical Staff

Automating DockerSlim in Your CICD Pipeline

Using GitHub Actions, you can refine container images automatically making them smaller, faster to load, and more secure by default – all without sacrificing any capabilities.

Nicolas Bohorquez

Contributor

Building Apps Using Cloud Native Buildpacks

Getting started with this innovative technique

Vince Power

Contributor

Building DockerSlim into a Jenkins Pipeline

A step by step tutorial on building DockerSlim into your CI/CD pipeline.

Clarifying the Complex: Meet Ivan Velichko, Container Dude at Slim.AI

Ivan recently joined the team at Slim.AI, and we sat down with him to learn more about the path that led him here.

Ivan Velichko

Container Dude

Container Insights: Dissecting the World's Most Popular Containers

Join Ayse Kaya in this series, as she creates her 2022 Container Report Chalk Full of Important Security Findings for Developers.

Ayse Kaya

Analytics & Strategy

Container of the Week: Python & Flask

Our weekly breakdown of a popular container

What We Discovered Analyzing the Top 100 Public Container Images

Complexity abounds in modern development

Ayse Kaya

Analytics & Strategy

2022 Public Container Report

Vulnerabilities continue to increase and developers are struggling to keep up.

Ayse Kaya

Analytics & Strategy

Containerizing Python Apps for Lambda

A tutorial on deploying AWS Lambda using containers, Python edition.

Docker Containers for Your Raspberry Pi

Compact PCs need compact apps

Martin Wimpress

Community

Explore and analyze a Docker container with DockerSlim X-Ray

Understanding container composition

Martin Wimpress

Community

Five Proven Ways to Debug a Container

When Things Just Are Not Working

Theofanis Despoudis

Contributor

Five Things You Should Never Ship to Production in a Container

Here is our take on five things to avoid when creating a container or shipping it to production.

Chris Tozzi

Increasing Your CI/CD Velocity with Slim Containers

We’ll explain what Slim Containers are, how they speed up the build process, and how they can improve the efficiency of your testing.

Mike Mackrory

Contributor

Integrate Testing into Your Container Pipeline

A closer look at testing within container pipelines, CI/CD, software delivery, and containerization.

Faith Kilonzi

Software Engineer

Reducing Docker Image Size - Slimming vs Compressing

Know the difference

Pieter van Noordennen

Growth

Serverless Applications and Docker

How to Scale the Latest Trend in Infrastructure

Pieter van Noordennen

Growth

Slim.AI Docker Extension for Docker Desktop

How to access our Docker Extension and try it for yourself.

Josh Viney

Product

Slimming a Rails Application with DockerSlim

Dissect a simple Rails application container using DockerSlim to analyze, optimize, and deploy your product more quickly.

Theofanis Despoudis

Contributor

Where Do You Store Your Container Images?

Container Registry Options are Growing in Number and Complexity

Pieter van Noordennen

Growth

Using AppArmor and SecComp Profiles for Security Audits

Conduct better container security audits using tools like SecComp, NGINX, and Docker.

What’s in your container?

Why Docker Layers matter for container optimization

Pieter van Noordennen

Growth

Why Developers Shouldn't Have to Be Infrastructure Experts, Too

Simplifying processes required to containerize and deploy cloud-native apps.

Chris Tozzi

A New Workflow for Cloud Development

Leverage the benefits of containerization without the headaches & hassle

John Amaral

CEO

Why Don’t We Practice Container Best Practices?

Container best practices are easy to understand, hard to do

John Amaral

CEO

Better Security Audits with AppArmor and SecComp via DockerSlim

Combine the power of tools like SecComp, NGINX, and Docker.

Cloud Development Is Still Too Manual & Complex

Lessons we learned from interviewing more than 30 developers

John Amaral

CEO

Getting Started with Multi-Container Apps

Up your container game with Docker Compose

Nicholas Bohorquez

Contributor

The Squeak Interview

CEO John Amaral joins Chris on his livestream

Meet DockerSlim's Compose Mode

Optimize a multi-tier app with a single command

Ian Juma

Technical Staff