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/trunk@1492365 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b090bc1c21
commit
80eb92aff0
@ -315,6 +315,9 @@ Release 2.1.0-beta - UNRELEASED
|
|||||||
YARN-731. RPCUtil.unwrapAndThrowException should unwrap remote
|
YARN-731. RPCUtil.unwrapAndThrowException should unwrap remote
|
||||||
RuntimeExceptions. (Zhijie Shen via sseth)
|
RuntimeExceptions. (Zhijie Shen via sseth)
|
||||||
|
|
||||||
|
YARN-600. Hook up cgroups CPU settings to the number of virtual cores
|
||||||
|
allocated. (sandyr via tucu)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
YARN-512. Log aggregation root directory check is more expensive than it
|
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.
|
* 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,
|
private void setupLimits(ContainerId containerId,
|
||||||
Resource containerResource) throws IOException {
|
Resource containerResource) throws IOException {
|
||||||
String containerName = containerId.toString();
|
String containerName = containerId.toString();
|
||||||
|
|
||||||
if (isCpuWeightEnabled()) {
|
if (isCpuWeightEnabled()) {
|
||||||
createCgroup(CONTROLLER_CPU, containerName);
|
createCgroup(CONTROLLER_CPU, containerName);
|
||||||
|
int cpuShares = CPU_DEFAULT_WEIGHT * containerResource.getVirtualCores();
|
||||||
updateCgroup(CONTROLLER_CPU, containerName, "shares",
|
updateCgroup(CONTROLLER_CPU, containerName, "shares",
|
||||||
String.valueOf(CPU_DEFAULT_WEIGHT));
|
String.valueOf(cpuShares));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user