YARN-600. Hook up cgroups CPU settings to the number of virtual cores allocated. (sandyr via tucu)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1492366 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3af49516ca
commit
46e514b06b
|
@ -295,6 +295,9 @@ Release 2.1.0-beta - UNRELEASED
|
|||
YARN-731. RPCUtil.unwrapAndThrowException should unwrap remote
|
||||
RuntimeExceptions. (Zhijie Shen via sseth)
|
||||
|
||||
YARN-600. Hook up cgroups CPU settings to the number of virtual cores
|
||||
allocated. (sandyr via tucu)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
YARN-512. Log aggregation root directory check is more expensive than it
|
||||
|
|
|
@ -172,18 +172,15 @@ public class CgroupsLCEResourcesHandler implements LCEResourcesHandler {
|
|||
* Next three functions operate on all the resources we are enforcing.
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO: After YARN-2 is committed, we should call containerResource.getCpus()
|
||||
* (or equivalent) to multiply the weight by the number of requested cpus.
|
||||
*/
|
||||
private void setupLimits(ContainerId containerId,
|
||||
Resource containerResource) throws IOException {
|
||||
String containerName = containerId.toString();
|
||||
|
||||
if (isCpuWeightEnabled()) {
|
||||
createCgroup(CONTROLLER_CPU, containerName);
|
||||
int cpuShares = CPU_DEFAULT_WEIGHT * containerResource.getVirtualCores();
|
||||
updateCgroup(CONTROLLER_CPU, containerName, "shares",
|
||||
String.valueOf(CPU_DEFAULT_WEIGHT));
|
||||
String.valueOf(cpuShares));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue