YARN-782. vcores-pcores ratio functions differently from vmem-pmem ratio in misleading way. (sandyr via tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1493065 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2013-06-14 13:43:25 +00:00
parent 451f725b92
commit c881f2e93b
4 changed files with 8 additions and 23 deletions

View File

@ -317,6 +317,9 @@ Release 2.1.0-beta - UNRELEASED
YARN-692. Creating NMToken master key on RM and sharing it with NM as a part YARN-692. Creating NMToken master key on RM and sharing it with NM as a part
of RM-NM heartbeat. (Omkar Vinit Joshi via vinodkv) of RM-NM heartbeat. (Omkar Vinit Joshi via vinodkv)
YARN-782. vcores-pcores ratio functions differently from vmem-pmem ratio in
misleading way. (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

View File

@ -470,15 +470,10 @@ public class YarnConfiguration extends Configuration {
NM_PREFIX + "vmem-pmem-ratio"; NM_PREFIX + "vmem-pmem-ratio";
public static final float DEFAULT_NM_VMEM_PMEM_RATIO = 2.1f; public static final float DEFAULT_NM_VMEM_PMEM_RATIO = 2.1f;
/** Number of Physical CPU Cores which can be allocated for containers.*/ /** Number of Virtual CPU Cores which can be allocated for containers.*/
public static final String NM_VCORES = NM_PREFIX + "resource.cpu-cores"; public static final String NM_VCORES = NM_PREFIX + "resource.cpu-vcores";
public static final int DEFAULT_NM_VCORES = 8; public static final int DEFAULT_NM_VCORES = 8;
/** Conversion ratio for physical cores to virtual cores. */
public static final String NM_VCORES_PCORES_RATIO =
NM_PREFIX + "vcores-pcores-ratio";
public static final float DEFAULT_NM_VCORES_PCORES_RATIO = 2.0f;
/** NM Webapp address.**/ /** NM Webapp address.**/
public static final String NM_WEBAPP_ADDRESS = NM_PREFIX + "webapp.address"; public static final String NM_WEBAPP_ADDRESS = NM_PREFIX + "webapp.address";
public static final int DEFAULT_NM_WEBAPP_PORT = 8042; public static final int DEFAULT_NM_WEBAPP_PORT = 8042;

View File

@ -510,18 +510,10 @@
<property> <property>
<description>Number of CPU cores that can be allocated <description>Number of CPU cores that can be allocated
for containers.</description> for containers.</description>
<name>yarn.nodemanager.resource.cpu-cores</name> <name>yarn.nodemanager.resource.cpu-vcores</name>
<value>8</value> <value>8</value>
</property> </property>
<property>
<description>Ratio between virtual cores to physical cores when
allocating CPU resources to containers.
</description>
<name>yarn.nodemanager.vcores-pcores-ratio</name>
<value>2</value>
</property>
<property> <property>
<description>NM Webapp address.</description> <description>NM Webapp address.</description>
<name>yarn.nodemanager.webapp.address</name> <name>yarn.nodemanager.webapp.address</name>

View File

@ -124,14 +124,9 @@ public class NodeStatusUpdaterImpl extends AbstractService implements
YarnConfiguration.DEFAULT_NM_VMEM_PMEM_RATIO); YarnConfiguration.DEFAULT_NM_VMEM_PMEM_RATIO);
int virtualMemoryMb = (int)Math.ceil(memoryMb * vMemToPMem); int virtualMemoryMb = (int)Math.ceil(memoryMb * vMemToPMem);
int cpuCores = int virtualCores =
conf.getInt( conf.getInt(
YarnConfiguration.NM_VCORES, YarnConfiguration.DEFAULT_NM_VCORES); YarnConfiguration.NM_VCORES, YarnConfiguration.DEFAULT_NM_VCORES);
float vCoresToPCores =
conf.getFloat(
YarnConfiguration.NM_VCORES_PCORES_RATIO,
YarnConfiguration.DEFAULT_NM_VCORES_PCORES_RATIO);
int virtualCores = (int)Math.ceil(cpuCores * vCoresToPCores);
this.totalResource = recordFactory.newRecordInstance(Resource.class); this.totalResource = recordFactory.newRecordInstance(Resource.class);
this.totalResource.setMemory(memoryMb); this.totalResource.setMemory(memoryMb);
@ -144,7 +139,7 @@ public class NodeStatusUpdaterImpl extends AbstractService implements
LOG.info("Initialized nodemanager for " + nodeId + ":" + LOG.info("Initialized nodemanager for " + nodeId + ":" +
" physical-memory=" + memoryMb + " virtual-memory=" + virtualMemoryMb + " physical-memory=" + memoryMb + " virtual-memory=" + virtualMemoryMb +
" physical-cores=" + cpuCores + " virtual-cores=" + virtualCores); " virtual-cores=" + virtualCores);
super.serviceInit(conf); super.serviceInit(conf);
} }