Configure CPU scheduling and isolation

You can configure CPU scheduling on your cluster to allocate the best possible nodes having the required CPU resources for application containers.

  1. In Cloudera Manager, select the YARN service.
  2. Click the Configuration tab.
  3. Search for Resource Calculator Class.
  4. Select the org.apache.hadoop.yarn.util.resource.DominantResourceCalculator option.
  5. Search for yarn.nodemanager.resource.cpu-vcores and set the number of vcores to match the number of physical CPU cores on the NodeManager host by providing the number of physical cores.

Enable cgroups along with CPU scheduling. Cgroups is used as the isolation mechanism for CPU processes. With cgroups strict enforcement activated, each CPU process receives only the resources it requests. Without cgroups activated, the DRF scheduler attempts to balance the load, but unpredictable behavior may occur. For more information, see Enabling cgroups.