What are control groups in linux?



  • cgroups for short were added to the linux kernel in 2007.

    A way of grouping up processes and allocating, prioritising, denying, managing, and monitoring system resources to those groups.

    Control Groups (cgroups). The diagram below shows how cgroups work, without using the cgroup terminology.

    0_1548929486743_cgroups.jpg

    Following the order of the numbers on the right of the diagram:

    1.) Server resources, disk, memory, cpu, and network.
    2.) The resources as show in 1, allocated in this example to 3 cgroups.
    3.) Hierarchically ordered groups of processes running on the system.

    Note:

    • The diagram shows resources being allocated to each cgroup in equal measure, but it may have a combination of 1 or more resources, cgroup2 for example could just have cpu and memory, what gets allocated depends on how you configure the cgroups.

    The result is, by using cgroups, more accurate control is gained over allocating, prioritising, denying, managing, and monitoring system resources.

    The diagram below shows the resource terminology with cgroups.

    0_1548938631342_cgroupsres.jpg


Log in to reply
 

© Lightnetics 2024