官术网_书友最值得收藏!

  • Getting Started with Kubernetes
  • Jonathan Baier Jesse White
  • 313字
  • 2021-06-10 19:46:56

cgroups

cgroups work by allowing the host to share and also limit the resources each process or container can consume. This is important for both resource utilization and security, as it prevents denial-of-service (DoS) attacks on the host's hardware resources. Several containers can share CPU and memory while staying within the predefined constraints. cgroups allow containers to provision access to memory, disk I/O, network, and CPU. You can also access devices (for example, /dev/foo). cgroups also power the soft and hard limits of container constraints that we'll discuss in later chapters.

There are seven major cgroups:

  • Memory cgroup: This keeps track of page access by the group, and can define limits for physical, kernel, and total memory.
  • Blkio cgroup: This tracks the I/O usage per group, across the read and write activity per block device. You can throttle by group per device, on operations versus bytes, and for reads versus writes.
  • CPU cgroup: This keeps track of user and system CPU time and usage per CPU. This allows you to set weights, but not limits.
  • Freezer cgroup: This is useful in batch management systems that are often stopping and starting tasks in order to schedule resources efficiently. The SIGSTOP signal is used to suspend a process, and the process is generally unaware that it is being suspended (or resumed, for that matter.)
  • CPUset cgroup: This allows you to pin a group to a specific CPU within a multi-core CPU architecture. You can pin by application, which will prevent it from moving between CPUs. This can improve the performance of your code by increasing the amount of local memory access or minimizing thread switching.
  • Net_cls/net_prio cgroup: This keeps tabs on the egress traffic class (net_cls)  or priority (net_prio) that is generated by the processes within the cgroup.
  • Devices cgroup: This controls what read/write permissions the group has on device nodes.
主站蜘蛛池模板: 页游| 石狮市| 辽宁省| 天气| 河源市| 香河县| 新泰市| 稻城县| 偏关县| 将乐县| 临泉县| 八宿县| 司法| 奎屯市| 温州市| 庆云县| 招远市| 兰考县| 昌黎县| 梅河口市| 偏关县| 成安县| 霍城县| 内江市| 连云港市| 江源县| 湟中县| 岳池县| 无棣县| 五原县| 肥乡县| 四川省| 台前县| 巴青县| 黄山市| 岳普湖县| 宜宾市| 梨树县| 泸西县| 余姚市| 湖北省|