VOOZH about

URL: https://thenewstack.io/linux-cgroups-v2-brings-rootless-containers-superior-memory-management/

⇱ Linux cgroups v2 Brings Rootless Containers, Superior Memory Management - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2020-09-01 03:00:30
Linux cgroups v2 Brings Rootless Containers, Superior Memory Management
news,
Cloud Native Ecosystem / Containers / Linux

Linux cgroups v2 Brings Rootless Containers, Superior Memory Management

Sep 1st, 2020 3:00am by Jack Wallen
👁 Featued image for: Linux cgroups v2 Brings Rootless Containers, Superior Memory Management
Feature image by Hebi B. from Pixabay.

Containers and container management tools have a lot of moving parts. Although you could very quickly deploy a single Docker container without much thought, the larger you scale up that container and the more services you add to it, the more complicated it becomes. In fact, Kubernetes deployments can very quickly become incredibly complex. They can also become very demanding on resources.

One part of the moving picture of containers is cgroups. Originally created by Google, and incorporated into the Linux kernel 2.6.24, cgroup stands for “control group” and is a means to manage how much computational resources used by a set of processes (i.e. a container). With cgroups you can do things like isolate core workloads from background tasks, prevent one workload from overpowering other workloads, and much more.

Up until recently, container developers have been using cgroups v1. However, cgroups v2, available as of the 4.5 version of the kernel, is now available and supported by most container deployment systems. This new version includes a number of important changes that container developers will want to know about.

Simplicity

The biggest change to cgroups in v2 is a focus on simplicity to the hierarchy. Where v1 used independent trees for each controller (such as /sys/fs/cgroup/cpu/GROUPNAME and /sys/fs/cgroup/memory/GROUPNAME), v2 will unify those in /sys/fs/cgroup/GROUPNAME. In the same vein, if Process X joins /sys/fs/cgroup/test, every controller enabled for test will control Process X.

For example, in cgroups v2, memory protection is configured in four files:

  • memory.min: this memory will never be reclaimed.
  • memory.low: memory below this threshold is reclaimed if there’s no other reclaimable memory in other cgroups.
  • memory.high: the kernel will attempt to keep memory usage below this configuration.
  • memory.max: if memory reaches this level the OOM killer (a system used to sacrifice one or more processes to free up memory for the system when all else fails) is invoked on the cgroup.

Rootless Containers

Rootless containers have become a very popular means to prevent runtime vulnerabilities in containers. Why rootless containers? With this added security layer, if a container is compromised, the attacker won’t be able to gain root privileges on the host. Rootless containers also allow isolation between nested containers. The problem to date has been that cgroups v1 did not support imposing resource limitations on rootless containers. That all changes with cgroups v2, as rootless containers will now include the resource limitation feature.

Other Changes

Other changes found in cgroups v2 include the likes of:

  • Cgroup controllers now negotiate with subsystems before problems can actually occur. Those subsystems are also capable of taking action to remediate the problems.
  • Global inotify support.
  • Single unified hierarchy means no sync is required.
  • More upfront design.
  • Universal thresholds.

Runtime Support

It’s important to know that most high-level container runtimes (Containerd, Docker, Podman, and Kubernetes) are now capable of fully supporting cgroups v2. Most of this support came into being as of Nov. 2019, but with cgroups v1 being deprecated, it’s time to start making the challenging migration from v1 to v2.

TRENDING STORIES
Jack Wallen is what happens when a Gen Xer mind-melds with present-day snark. Jack is a seeker of truth and a writer of words with a quantum mechanical pencil and a disjointed beat of sound and soul. Although he resides...
Read more from Jack Wallen
SHARE THIS STORY
TRENDING STORIES
The Linux Foundation is a sponsor of The New Stack.
TNS owner Insight Partners is an investor in: Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.