Understanding Container Technology: The Magic of cgroups and Namespaces

I originally planned to make a video this topic, but my 2019 MacBook Pro (Intel) had other ideas. Adobe Premiere Pro demands at least 2GB of GPU memory, and my MacBook sheepishly offered just 1.5GB. Trying to edit videos turned my computer into a spinning beach ball death machine.

UGH! (And yes, I did turn it off and on again) 🤪

Despite my computer’s temper tantrums, I’m here to share some of my understanding and insights on container technology. There are plenty of resources out there, but I hope to sprinkle in a bit of magic (and humor) to make this topic more digestible. Explaining things helps me understand them better, so let’s learn together and have some fun along the way.

The Magic of cgroups and Namespaces

A simple whiteboard (blackboard?) on the relationship between cgroups and namespaces

First, let’s talk about cgroups and namespaces. No, these aren’t the names of a new indie band. They’re fundamental concepts in container technology. cgroups (originally termed as “process group” and later renamed to “control group” or just cgroup) were originally created by Google around 2006. Think of them as resource managers that ensure your CPU, memory, network, and disk don’t throw a party and crash your system. Version 2 of cgroups is like a super nanny, keeping an eye on each process individually1.

Namespaces2 are like VIP sections at a club. They make sure each process party stays exclusive, with its own set of resources, and no crashing into other parties3.

Why does it matter?

These two pieces are crucial for containers to work their magic. Unlike physical PCs or virtual machines (VMs) that run a whole operating system (OS) and can get into resource tussles, containers keep things neat and tidy. They wrap an application and its dependencies into a neat little package, isolating them from the host OS (gee.. that does sound like a ThinApp Package, doesn’t it?).

Imagine containers as the ultimate takeout box for your application (packed with microservices and side dishes). It’s designed to run anywhere without asking, “Is this gluten-free?”

However, moving a traditional app to a container isn’t like throwing leftovers in Tupperware. It involves refactoring4, a fancy term for redesigning. Not all apps fit neatly into containers (that’s where ThinApp, App Volumes, or Workspace ONE might step in). But for those that do, it’s a game-changer.

As someone who’s been on the administrative end of a container usage with Horizon Cloud, I can say containerization is like having a personal chef. One standout benefit is upgrading and updating apps. Instead of overhauling the whole shebang, you can update individual microservices on the fly, making your life (and your apps) much happier.

That’s all for now. Much like my original intention for the video was to release information in smaller chunks to make knowledge retention better. Plus, it’s easier to keep it light and fun when it’s in smaller chunks.

And, of course, to keep you coming back for more! 😉

  1. Wiki on cgroups: https://en.wikipedia.org/wiki/Cgroups ↩︎
  2. Wiki on generic namespaces: https://en.wikipedia.org/wiki/Namespace ↩︎
  3. Linux namespaces are closer to what containers use. Wiki on Linux namespaces: https://en.wikipedia.org/wiki/Linux_namespaces ↩︎
  4. Refactoring as defined by VMware by Broadcom: https://www.vmware.com/topics/glossary/content/application-refactoring.html ↩︎



One response to “Understanding Container Technology: The Magic of cgroups and Namespaces”

  1. […] week, I delved into cgroups and namespaces, the foundational pillars of containers. But before we dive deeper into containers, let’s take a […]

Leave a Reply

Discover more from The Virtual Buddha: Learning How to Navigate the World

Subscribe now to keep reading and get access to the full archive.

Continue reading