What are namespaces and cgroups, and how do they work?

Click for: original source

Recently, I have been investigating NGINX Unit, our open source multi-language application server. As part of my investigation, I noticed that Unit supports both namespaces and cgroups, which enables process isolation. In this blog, we’ll look at these two major Linux technologies, which also underlie containers. By Scott van Kalken of F5.

Containers and associated tools like Docker and Kubernetes have been around for some time now. They have helped to change how software is developed and delivered in modern application environments. Containers make it possible to quickly deploy and run each piece of software in its own segregated environment, without the need to build individual virtual machines (VMs).

The article then focuses on:

  • What are namespaces?
    • Types of namespaces
    • An example of parent and child PID namespaces
    • Creating a namespace
    • Looking at a namespace from the outside
  • What are cgroups?
    • Cgroup versions
    • Creating a cgroup

Namespaces and cgroups are the building blocks for containers and modern applications. Having an understanding of how they work is important as we refactor applications to more modern architectures. Excellent read!

[Read More]

Tags nginx devops linux