CPUShares
CPUShares is a scheduling mechanism used in the Linux kernel to allocate CPU time among processes. It is part of the Control Groups (cgroups) subsystem, which provides a way to organize and manage system resources. CPUShares is used to specify the relative weight of a process or a group of processes, determining how much CPU time they should receive compared to other processes. The weight is specified as an integer value, with higher values indicating a higher priority. The kernel then uses this information to schedule CPU time accordingly. CPUShares is particularly useful in containerized environments, such as Docker, where it helps to ensure that each container gets a fair share of the CPU resources. It is important to note that CPUShares does not provide strict guarantees on CPU usage; it is a best-effort mechanism. For more precise control over CPU resources, other cgroups subsystems like cpuset and cpu can be used in conjunction with CPUShares.