Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F38BF10947 for ; Tue, 23 Jul 2013 00:17:51 +0000 (UTC) Received: (qmail 45419 invoked by uid 500); 23 Jul 2013 00:17:47 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 45183 invoked by uid 500); 23 Jul 2013 00:17:47 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 45173 invoked by uid 99); 23 Jul 2013 00:17:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 00:17:47 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sandy.ryza@cloudera.com designates 209.85.192.179 as permitted sender) Received: from [209.85.192.179] (HELO mail-pd0-f179.google.com) (209.85.192.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 00:17:41 +0000 Received: by mail-pd0-f179.google.com with SMTP id q10so7431570pdj.24 for ; Mon, 22 Jul 2013 17:17:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=uqUqFdHVYDOzmR7C8x6yGvf60+dRRlUkKjSWpv33VkA=; b=OqAcYzT3jDOjtJ9Y6L9phCSp3xmkYf1U7enJhZeTDCHo7oCt0RRS7GlrGUx67oHOzo vvrHK++cyht42nRNDfmafbiR2Zj5bZ2EvCbepThcEnz+oofDgjuJTEpZkTZqfBB8SFPQ u5UVegaNY15IZIFQD75WwlY9aOioA4tzA9ppq4Y4keXc9uRRG99cC1ONDZZtX1sYdOOy s6QMME5ibiIZg/5AO5kDnzlVFx5Jm2qTzh6g55YzhZPw7MVSun9uHJSApNQmAQzJJGx3 RoeVbRYV8N6BPrMUj5ghUWkOC2+WnZt+nAb9Z7elDfYSdUzxHqXWOJkb4YXajZUeeCGC 7W7A== MIME-Version: 1.0 X-Received: by 10.68.27.105 with SMTP id s9mr33626139pbg.29.1374538641551; Mon, 22 Jul 2013 17:17:21 -0700 (PDT) Received: by 10.70.88.165 with HTTP; Mon, 22 Jul 2013 17:17:21 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Jul 2013 17:17:21 -0700 Message-ID: Subject: Re: Parameter 'yarn.nodemanager.resource.cpu-cores' does not work From: Sandy Ryza To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=bcaec520f1b975d6c704e222b7cc X-Gm-Message-State: ALoCoQnh/gGXg0pn5rh5wfaMkEcya9VVX0kgeA7ipDr8+XekC0kXVlxLSU2jSRKyES/Tljfn+udZ X-Virus-Checked: Checked by ClamAV on apache.org --bcaec520f1b975d6c704e222b7cc Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Sam, LinuxResourceCalculatorPlugin and DominantResourceCalculator control separate things. The former is for a NodeManager to calculate the resource usage of a container process so that it can kill it if it gets too large. The latter is used by the Capacity Scheduler to allocate containers, and, if you're using the Capacity Scheduler, in theory should do what you're expecting it to do. Based on the fix version of YARN-2, DominantResourceCalculator should be included in 2.0.4-alpha. The Fair Scheduler will support CPU-based scheduling as well starting in 2.1.0-beta. -Sandy On Sat, Jul 20, 2013 at 11:04 PM, sam liu wrote: > Thanks, but seems it does not work for me. > > My hadoop version is 'Hadoop 2.0.4-alpha', and seems it does not include = a > class named > 'org.apache.hadoop.yarn.util.resource.DominantResourceCalculator', so I > replaced it with > 'org.apache.hadoop.yarn.util.LinuxResourceCalculatorPlugin'. My > configuration is below, and use the default values for other > LinuxContainerExecutor configurations. In my expectation, if I set the > value of 'yarn.nodemanager.resource.cpu-cores' to 0, no job could be > completed by nodemanager as the slaves do not have any cpu to use. But, i= n > fact, my job could be completed successfully. Why? > > > yarn.nodemanager.resource.cpu-cores > 0 > > > > yarn.nodemanager.vcores-pcores-ratio > 0 > > > > > yarn.nodemanager.container-monitor.resource-calculator.class > > org.apache.hadoop.yarn.util.LinuxResourceCalculatorPlugin > > > > yarn.nodemanager.container-executor.class > > org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor > > > > > 2013/7/4 Chuan Liu > >> I think you need to change the following configurations in >> yarn-site.xml to enable CPU resource limits.**** >> >> ** ** >> >> =91yarn.nodemanager.container-monitor.resource-calculator.class=92 >> =91org.apache.hadoop.yarn.util.resource.DominantResourceCalculator=92***= * >> >> ** ** >> >> =91yarn.nodemanager.container-executor.class=92**** >> >> =91org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor=92**= ** >> >> ** ** >> >> Some LinuxContainerExecutor configurations:**** >> >> yarn.nodemanager.linux-container-executor.path**** >> >> yarn.nodemanager.linux-container-executor.resources-handler.class**** >> >> yarn.nodemanager.linux-container-executor.cgroups.hierarchy**** >> >> yarn.nodemanager.linux-container-executor.cgroups.mount**** >> >> yarn.nodemanager.linux-container-executor.cgroups.mount-path**** >> >> ** ** >> >> -Chuan**** >> >> ** ** >> >> *From:* sam liu [mailto:samliuhadoop@gmail.com] >> *Sent:* Tuesday, July 02, 2013 8:33 PM >> *To:* user@hadoop.apache.org >> *Subject:* Parameter 'yarn.nodemanager.resource.cpu-cores' does not work= * >> *** >> >> ** ** >> >> Hi,**** >> >> With Hadoop 2.0.4-alpha, yarn.nodemanager.resource.cpu-cores does not >> work for me:**** >> >> 1. The performance of running same terasort job do not change, even afte= r >> increasing or decreasing the value of 'yarn.nodemanager.resource.cpu-cor= es' >> in yarn-site.xml and restart the yarn cluster. **** >> >> 2. Even if I set the value of both >> 'yarn.nodemanager.resource.cpu-cores' and >> 'yarn.nodemanager.vcores-pcores-ratio' to 0, the MR job still could >> complete without any exception, but the expected behavior should be that= no >> cpu could be assigned to the container, and then no job could be execute= d >> on the cluster. Right?**** >> >> Thanks!**** >> >> ** ** >> > > --bcaec520f1b975d6c704e222b7cc Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
Hi Sam,

LinuxResourceCalculatorPlugin a= nd DominantResourceCalculator control separate things. =A0The former is for= a NodeManager to calculate the resource usage of a container process so th= at it can kill it if it gets too large. =A0The latter is used by the Capaci= ty Scheduler to allocate containers, and, if you're using the Capacity = Scheduler, in theory should do what you're expecting it to do. =A0Based= on the fix version of YARN-2, DominantResourceCalculator should be include= d in 2.0.4-alpha. =A0The Fair Scheduler will support CPU-based scheduling a= s well starting in 2.1.0-beta.

-Sandy


On Sat, Jul 20, 2013 at 11:04 PM, sam liu <s= amliuhadoop@gmail.com> wrote:
Thanks, but seems it d= oes not work for me.

My hadoop version is 'Hadoop 2.0.4-alpha&#= 39;, and seems it does not include a class named 'org.apache.hadoop.yar= n.util.resource.DominantResourceCalculator', so I replaced it with '= ;org.apache.hadoop.yarn.util.LinuxResourceCalculatorPlugin'. My configu= ration is below, and use the default values for other LinuxContainerExecuto= r configurations. In my expectation, if I set the value of 'yarn.nodema= nager.resource.cpu-cores' to 0, no job could be completed by nodemanage= r as the slaves do not have any cpu to use. But, in fact, my job could be c= ompleted successfully. Why?

=A0<property>
=A0=A0=A0 <name>yarn.nodemanager.resource.= cpu-cores</name>
=A0=A0=A0 <value>0</value>
=A0 <= ;/property>

=A0<property>
=A0=A0=A0 <name>yarn.nod= emanager.vcores-pcores-ratio</name>
=A0=A0=A0 <value>0</value>
=A0 </property>

=A0&= lt;property>
=A0=A0=A0 <name>yarn.nodemanager.container-monitor= .resource-calculator.class</name>
=A0=A0=A0 <value>org.apach= e.hadoop.yarn.util.LinuxResourceCalculatorPlugin</value>
=A0 </property>

=A0<property>
=A0=A0=A0 <name>y= arn.nodemanager.container-executor.class</name>
=A0=A0=A0 <valu= e>org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor</v= alue>
=A0 </property>



2013/7/4 Chuan Liu <ch= uanliu@microsoft.com>

I think you need to chang= e the following configurations in yarn-site.xml to enable CPU resource limi= ts.

=A0<= /p>

=91yarn.nodemanager.conta= iner-monitor.resource-calculator.class=92 =91org.apache.hadoop.yarn.util.re= source.DominantResourceCalculator=92

=A0<= /p>

=91yarn.nodemanager.conta= iner-executor.class=92

=91org.apache.hadoop.yarn= .server.nodemanager.LinuxContainerExecutor=92

=A0<= /p>

Some LinuxContainerExecut= or configurations:

yarn.nodemanager.linux-co= ntainer-executor.path

yarn.nodemanager.linux-co= ntainer-executor.resources-handler.class

yarn.nodemanager.linux-co= ntainer-executor.cgroups.hierarchy

yarn.nodemanager.linux-co= ntainer-executor.cgroups.mount

yarn.nodemanager.linux-co= ntainer-executor.cgroups.mount-path

=A0<= /p>

-Chuan

=A0<= /p>

From: sam li= u [mailto:samli= uhadoop@gmail.com]
Sent: Tuesday, July 02, 2013 8:33 PM
To: user= @hadoop.apache.org
Subject: Parameter 'yarn.nodemanager.resource.cpu-cores' doe= s not work

=A0

Hi,

With Hadoop 2.0.4-alpha, ya= rn.nodemanager.resource.cpu-cores does not work for me:

1. The performance of running same terasort job do not change, even aft= er increasing or decreasing the value of 'yarn.nodemanager.resource.cpu= -cores' in yarn-site.xml and restart the yarn cluster.=A0

2. Even if I set the value of both
'yarn.nodemanager.resource.cpu-cores' and = 'yarn.nodemanager.vcores-pcores-ratio' to 0, the MR job still could= complete without any exception, but the expected behavior should be that no cpu could be assigned to the container, and then no job could be execut= ed on the cluster. Right?

Thanks!

=A0



--bcaec520f1b975d6c704e222b7cc--