java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.AbstractCGroupsCpuResourceHandler
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.CGroupsCpuResourceHandlerImpl
All Implemented Interfaces:
CpuResourceHandler, ResourceHandler

@Unstable @Private public class CGroupsCpuResourceHandlerImpl extends AbstractCGroupsCpuResourceHandler
An implementation for using CGroups to restrict CPU usage on Linux. The implementation supports 3 different controls - restrict usage of all YARN containers, restrict relative usage of individual YARN containers and restrict usage of individual YARN containers. Admins can set the overall CPU to be used by all YARN containers - this is implemented by setting cpu.cfs_period_us and cpu.cfs_quota_us to the ratio desired. If strict resource usage mode is not enabled, cpu.shares is set for individual containers - this prevents containers from exceeding the overall limit for YARN containers but individual containers can use as much of the CPU as available(under the YARN limit). If strict resource usage is enabled, then container can only use the percentage of CPU allocated to them and this is again implemented using cpu.cfs_period_us and cpu.cfs_quota_us.