Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A3A6A17415 for ; Tue, 29 Sep 2015 11:23:17 +0000 (UTC) Received: (qmail 79290 invoked by uid 500); 29 Sep 2015 11:22:56 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 79177 invoked by uid 500); 29 Sep 2015 11:22:56 -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 79167 invoked by uid 99); 29 Sep 2015 11:22:55 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2015 11:22:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7C2BEC7014 for ; Tue, 29 Sep 2015 11:22:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.899 X-Spam-Level: ** X-Spam-Status: No, score=2.899 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 8OsYrt4us8HZ for ; Tue, 29 Sep 2015 11:22:53 +0000 (UTC) Received: from mail-io0-f194.google.com (mail-io0-f194.google.com [209.85.223.194]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 61F8120596 for ; Tue, 29 Sep 2015 11:22:53 +0000 (UTC) Received: by ioiz6 with SMTP id z6so611787ioi.3 for ; Tue, 29 Sep 2015 04:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TYfXSvErExgFxhKFB096xAiKoPjJkmvDb2J60JdBxlo=; b=kEme3Q6T9BO/XSzPxd3eHsNj0FdhnHhN7V/gT8d5vmDMdqUNB8klSC/EvOW0Zx959M DCMFN0d7L7XcFgCJPqPHnm8pbl0ijOzrwKHwruVgFoQ/AXUIsv71FPopoYcuCXULrfPK tOncQcpmH5URsAR6aEBm7s2wmcIsvmfUOY5i9Ji45iv4uD34qUkV05DG9ehCpdP1egID aFJy4qkUPppoFPIpAkwOAtnWTAfSlGzPJU258c3i9OIAT95ZXAsQcnQ33ErNXEfrtadv Knx8l0iZU6dwcMQoI+SS4tZor/F5p8oeT/cSFtyHNUESKhRwrMN/xO3g2ycDSrp0DQLa Qfrg== MIME-Version: 1.0 X-Received: by 10.107.19.234 with SMTP id 103mr28828349iot.41.1443525772486; Tue, 29 Sep 2015 04:22:52 -0700 (PDT) Received: by 10.107.170.209 with HTTP; Tue, 29 Sep 2015 04:22:52 -0700 (PDT) In-Reply-To: References: <0EE80F6F7A98A64EBD18F2BE839C9115679626ED@szxeml512-mbs.china.huawei.com> Date: Tue, 29 Sep 2015 16:52:52 +0530 Message-ID: Subject: Re: Concurrency control From: Laxman Ch To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001a113f7a92e4df970520e1084e --001a113f7a92e4df970520e1084e Content-Type: text/plain; charset=UTF-8 IMO, its better to have a application level configuration than to have a scheduler/queue level configuration. Having a queue level configuration will restrict every single application that runs in that queue. But, we may want to configure these limits for only some set of jobs and also for every application these limits can be different. FairOrdering policy thing, order of jobs can't be enforced as these are adhoc jobs and scheduled/owned independently by different teams. On 29 September 2015 at 16:43, Naganarasimha G R (Naga) < garlanaganarasimha@huawei.com> wrote: > Hi Laxman, > > What i meant was, suppose if we support and configure > yarn.scheduler.capacity..app-limit-factor to .25 then a > single app should not take more than 25 % of resources in the queue. > This would be a more generic configuration which can be enforced by the > admin, than expecting it to be configured for per app by the user. > > And for Rohith's suggestion of FairOrdering policy , I think it should > solve the problem if the App which is submitted first is not already hogged > all the queue's resources. > > + Naga > > ------------------------------ > *From:* Laxman Ch [laxman.lux@gmail.com] > *Sent:* Tuesday, September 29, 2015 16:03 > > *To:* user@hadoop.apache.org > *Subject:* Re: Concurrency control > > Thanks Rohit, Naga and Lloyd for the responses. > > > I think Laxman should also tell us more about which application type he > is running. > > We run mr jobs mostly with default core/memory allocation (1 vcore, 1.5GB). > Our problem is more about controlling the * resources used simultaneously > by all running containers *at any given point of time per application. > > Example: > 1. App1 and App2 are two MR apps. > 2. App1 and App2 belong to same queue (capacity: 100 vcores, 150 GB). > 3. Each App1 task takes 8 hrs for completion > 4. Each App2 task takes 5 mins for completion > 5. App1 triggered at time "t1" and using all the slots of queue. > 6. App2 triggered at time "t2" (where t2 > t1) and waits longer fot App1 > tasks to release the resources. > 7. We can't have preemption enabled as we don't want to lose the work > completed so far by App1. > 8. We can't have separate queues for App1 and App2 as we have lots of jobs > like this and it will explode the number of queues. > 9. We use CapacityScheduler. > > In this scenario, if I can control App1 concurrent usage limits to > 50vcores and 75GB, then App1 may take longer time to finish but there won't > be any starvation for App2 (and other jobs running in same queue) > > @Rohit, FairOrdering policy may not solve this starvation problem. > > @Naga, I couldn't think through the expected behavior of " > yarn.scheduler.capacity..app-limit-factor" > I will revert on this. > > On 29 September 2015 at 14:57, Namikaze Minato > wrote: > >> I think Laxman should also tell us more about which application type >> he is running. The normal use cas of MAPREDUCE should be working as >> intended, but if he has for example one MAP using 100 vcores, then the >> second map will have to wait until the app completes. Same would >> happen if the applications running were spark, as spark does not free >> what is allocated to it. >> >> Regards, >> LLoyd >> >> On 29 September 2015 at 11:22, Naganarasimha G R (Naga) >> wrote: >> > Thanks Rohith for your thoughts , >> > But i think by this configuration it might not completely solve >> the >> > scenario mentioned by Laxman, As if the there is some time gap between >> first >> > and and the second app then though we have fairness or priority set for >> apps >> > starvation will be there. >> > IIUC we can think of an approach where in we can have something similar >> to >> > "yarn.scheduler.capacity..user-limit-factor" where in it >> can >> > provide the functionality like >> > "yarn.scheduler.capacity..app-limit-factor" : The multiple >> of >> > the queue capacity which can be configured to allow a single app to >> acquire >> > more resources. Thoughts ? >> > >> > + Naga >> > >> > >> > >> > ________________________________ >> > From: Rohith Sharma K S [rohithsharmaks@huawei.com] >> > Sent: Tuesday, September 29, 2015 14:07 >> > To: user@hadoop.apache.org >> > Subject: RE: Concurrency control >> > >> > Hi Laxman, >> > >> > >> > >> > In Hadoop-2.8(Not released yet), CapacityScheduler provides >> configuration >> > for configuring ordering policy. By configuring FAIR_ORDERING_POLICY >> in CS >> > , probably you should be able to achieve your goal i.e avoiding >> starving of >> > applications for resources. >> > >> > >> > >> > >> > >> > >> org.apache.hadoop.yarn.server.resourcemanager.scheduler.policy.FairOrderingPolicy >> > >> > An OrderingPolicy which orders SchedulableEntities for fairness (see >> > FairScheduler FairSharePolicy), generally, processes with lesser usage >> are >> > lesser. If sizedBasedWeight is set to true then an application with high >> > demand may be prioritized ahead of an application with less usage. This >> is >> > to offset the tendency to favor small apps, which could result in >> starvation >> > for large apps if many small ones enter and leave the queue continuously >> > (optional, default false) >> > >> > >> > >> > >> > >> > Community Issue Id : https://issues.apache.org/jira/browse/YARN-3463 >> > >> > >> > >> > Thanks & Regards >> > >> > Rohith Sharma K S >> > >> > >> > >> > From: Laxman Ch [mailto:laxman.lux@gmail.com] >> > Sent: 29 September 2015 13:36 >> > To: user@hadoop.apache.org >> > Subject: Re: Concurrency control >> > >> > >> > >> > Bouncing this thread again. Any other thoughts please? >> > >> > >> > >> > On 17 September 2015 at 23:21, Laxman Ch wrote: >> > >> > No Naga. That wont help. >> > >> > >> > >> > I am running two applications (app1 - 100 vcores, app2 - 100 vcores) >> with >> > same user which runs in same queue (capacity=100vcores). In this >> scenario, >> > if app1 triggers first occupies all the slots and runs longs then app2 >> will >> > starve longer. >> > >> > >> > >> > Let me reiterate my problem statement. I wanted "to control the amount >> of >> > resources (vcores, memory) used by an application SIMULTANEOUSLY" >> > >> > >> > >> > On 17 September 2015 at 22:28, Naganarasimha Garla >> > wrote: >> > >> > Hi Laxman, >> > >> > For the example you have stated may be we can do the following things : >> > >> > 1. Create/modify the queue with capacity and max cap set such that its >> > equivalent to 100 vcores. So as there is no elasticity, given >> application >> > will not be using the resources beyond the capacity configured >> > >> > 2. yarn.scheduler.capacity..minimum-user-limit-percent so >> that >> > each active user would be assured with the minimum guaranteed resources >> . By >> > default value is 100 implies no user limits are imposed. >> > >> > >> > >> > Additionally we can think of >> > >> "yarn.nodemanager.linux-container-executor.cgroups.strict-resource-usage" >> > which will enforce strict cpu usage for a given container if required. >> > >> > >> > >> > + Naga >> > >> > >> > >> > On Thu, Sep 17, 2015 at 4:42 PM, Laxman Ch >> wrote: >> > >> > Yes. I'm already using cgroups. Cgroups helps in controlling the >> resources >> > at container level. But my requirement is more about controlling the >> > concurrent resource usage of an application at whole cluster level. >> > >> > >> > >> > And yes, we do configure queues properly. But, that won't help. >> > >> > >> > >> > For example, I have an application with a requirement of 1000 vcores. >> But, I >> > wanted to control this application not to go beyond 100 vcores at any >> point >> > of time in the cluster/queue. This makes that application to run longer >> even >> > when my cluster is free but I will be able meet the guaranteed SLAs of >> other >> > applications. >> > >> > >> > >> > Hope this helps to understand my question. >> > >> > >> > >> > And thanks Narasimha for quick response. >> > >> > >> > >> > On 17 September 2015 at 16:17, Naganarasimha Garla >> > wrote: >> > >> > Hi Laxman, >> > >> > Yes if cgroups are enabled and >> "yarn.scheduler.capacity.resource-calculator" >> > configured to DominantResourceCalculator then cpu and memory can be >> > controlled. >> > >> > Please Kindly furhter refer to the official documentation >> > http://hadoop.apache.org/docs/r1.2.1/capacity_scheduler.html >> > >> > >> > >> > But may be if say more about problem then we can suggest ideal >> > configuration, seems like capacity configuration and splitting of the >> queue >> > is not rightly done or you might refer to Fair Scheduler if you want >> more >> > fairness for container allocation for different apps. >> > >> > >> > >> > On Thu, Sep 17, 2015 at 4:10 PM, Laxman Ch >> wrote: >> > >> > Hi, >> > >> > >> > >> > In YARN, do we have any way to control the amount of resources (vcores, >> > memory) used by an application SIMULTANEOUSLY. >> > >> > >> > >> > - In my cluster, noticed some large and long running mr-app occupied >> all the >> > slots of the queue and blocking other apps to get started. >> > >> > - I'm using Capacity schedulers (using hierarchical queues and >> preemption >> > disabled) >> > >> > - Using Hadoop version 2.6.0 >> > >> > - Did some googling around this and gone through configuration docs but >> I'm >> > not able to find anything that matches my requirement. >> > >> > >> > >> > If needed, I can provide more details on the usecase and problem. >> > >> > >> > >> > -- >> > >> > Thanks, >> > Laxman >> > >> > >> > >> > >> > >> > >> > >> > -- >> > >> > Thanks, >> > Laxman >> > >> > >> > >> > >> > >> > >> > >> > -- >> > >> > Thanks, >> > Laxman >> > >> > >> > >> > >> > >> > -- >> > >> > Thanks, >> > Laxman >> > > > > -- > Thanks, > Laxman > -- Thanks, Laxman --001a113f7a92e4df970520e1084e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
IMO, its better to have a application level configuration = than to have a scheduler/queue level configuration.
Having a queue leve= l configuration will restrict every single application that runs in that qu= eue.
But, we may want to configure these limits for only some set= of jobs and also for every application these limits can be different.

FairOrdering policy thing, order of jobs can'= t be enforced as these are adhoc jobs and scheduled/owned independently by = different teams.

On 29 September 2015 at 16:43, Naganarasimha G R (Naga) <garlanaganarasimha@huawei.com> wrote:
Hi Laxman,
=C2=A0
What i meant was, =C2=A0suppose if we support and configure=C2=A0yarn.scheduler.capacity.<queue-path>.app-l= imit-factor=C2=A0to .25 =C2=A0then a single app should not take more than 25 % of resources in= the queue.
This would be a more generic configuration which can be enforced by th= e admin, than expecting it to be configured for per app by the user.

And for Rohith's suggestion of=C2=A0FairOrdering policy=C2=A0, I think i= t=C2=A0should solve the problem if the App which is submitted first = is not already hogged all the queue's resources.

+ Naga


From: Laxman Ch [laxman.lux@gmail.com]
Sent: Tuesday, September 29, 2015 16:03

To: user= @hadoop.apache.org
Subject: Re: Concurrency control

Thanks Rohit, Naga and Lloyd for the responses.

>=C2=A0I think Laxman should also = tell us more about which application type=C2=A0he is running.

We run mr jobs mostly with default co= re/memory allocation (1 vcore, 1.5GB).
Our problem is more about controlling= the resources used simultaneously by all running containers at any given po= int of time per application.

Example:=C2=A0
1. App1 and App2 are two MR apps.
2. App1 and App2 belong to same queue (capacity: 100 vcores, 150 GB).<= /div>
3. Each App1 task takes 8 hrs for completion
4. Each App2 task takes 5 mins for completion
5. App1 triggered at time "t1" and using all the slots of qu= eue.
6. App2 triggered at time "t2" (where t2 > t1) and waits = longer fot App1 tasks to release the resources.
7. We can't have preemption enabled as we don't want to lose t= he work completed so far by App1.
8. We can't have separate queues for App1 and App2 as we have lots= of jobs like this and it will explode the number of queues.
9. We use CapacityScheduler.

In this scenario, if I can control App1 concurrent usage limits to 50v= cores and 75GB, then App1 may take longer time to finish but there won'= t be any starvation for App2 (and other jobs running in same queue)

@Rohit, FairOrdering policy may not solve this starvation problem.

@Naga, I couldn't think through the expected behavior of=C2=A0"<= /span>yarn.scheduler.capacity.<queue-pat= h>.app-limit-factor"
I will revert on this.

On 29 September 2015 at 14:57, Namikaze Minato <= span dir=3D"ltr"> <lloydsensei@= gmail.com> wrote:
I think Laxman should also tell us more about which application type
he is running. The normal use cas of MAPREDUCE should be working as
intended, but if he has for example one MAP using 100 vcores, then the
second map will have to wait until the app completes. Same would
happen if the applications running were spark, as spark does not free
what is allocated to it.

Regards,
LLoyd

On 29 September 2015 at 11:22, Naganarasimha G R (Naga)
<garlanaganarasimha@huawei.com> wrote:
> Thanks Rohith for your thoughts ,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0But i think by this configuration it might n= ot completely solve the
> scenario mentioned by Laxman, As if the there is some time gap between= first
> and and the second app then though we have fairness or priority set fo= r apps
> starvation will be there.
> IIUC we can think of an approach where in we can have something simila= r to
> "yarn.scheduler.capacity.<queue-path>.user-limit-factor&quo= t;=C2=A0 where in it can
> provide=C2=A0 the functionality like
> "yarn.scheduler.capacity.<queue-path>.app-limit-factor"= ; : The multiple of
> the queue capacity which can be configured to allow a single app to ac= quire
> more resources.=C2=A0 Thoughts ?
>
> + Naga
>
>
>
> ________________________________
> From: Rohith Sharma K S [rohithsharmaks@huawei.com]
> Sent: Tuesday, September 29, 2015 14:07
> To: user@h= adoop.apache.org
> Subject: RE: Concurrency control
>
> Hi Laxman,
>
>
>
> In Hadoop-2.8(Not released=C2=A0 yet),=C2=A0 CapacityScheduler provide= s configuration
> for configuring ordering policy.=C2=A0 By configuring FAIR_ORDERING_PO= LICY in CS
> , probably you should be able to achieve=C2=A0 your goal i.e avoiding = starving of
> applications for resources.
>
>
>
>
>
> org.apache.hadoop.yarn.server.resourcemanager.scheduler.policy.FairOrd= eringPolicy<S>
>
> An OrderingPolicy which orders SchedulableEntities for fairness (see > FairScheduler FairSharePolicy), generally, processes with lesser usage= are
> lesser. If sizedBasedWeight is set to true then an application with hi= gh
> demand may be prioritized ahead of an application with less usage. Thi= s is
> to offset the tendency to favor small apps, which could result in star= vation
> for large apps if many small ones enter and leave the queue continuous= ly
> (optional, default false)
>
>
>
>
>
> Community Issue Id :=C2=A0 https://issues.apache.org/jira/browse/YARN-3463
>
>
>
> Thanks & Regards
>
> Rohith Sharma K S
>
>
>
> From: Laxman Ch [mailto:laxman.lux@gmail.com]
> Sent: 29 September 2015 13:36
> To: user@h= adoop.apache.org
> Subject: Re: Concurrency control
>
>
>
> Bouncing this thread again. Any other thoughts please?
>
>
>
> On 17 September 2015 at 23:21, Laxman Ch <laxman.lux@gmail.com> wrote:
>
> No Naga. That wont help.
>
>
>
> I am running two applications (app1 - 100 vcores, app2 - 100 vcores) w= ith
> same user which runs in same queue (capacity=3D100vcores). In this sce= nario,
> if app1 triggers first occupies all the slots and runs longs then app2= will
> starve longer.
>
>
>
> Let me reiterate my problem statement. I wanted "to control the a= mount of
> resources (vcores, memory) used by an application SIMULTANEOUSLY"=
>
>
>
> On 17 September 2015 at 22:28, Naganarasimha Garla
> <na= ganarasimha.gr@gmail.com> wrote:
>
> Hi Laxman,
>
> For the example you have stated may be we can do the following things = :
>
> 1. Create/modify the queue with capacity and max cap set such that its=
> equivalent to 100 vcores. So as there is no elasticity, given applicat= ion
> will not be using the resources beyond the capacity configured
>
> 2. yarn.scheduler.capacity.<queue-path>.minimum-user-limit-perce= nt=C2=A0 =C2=A0so that
> each active user would be assured with the minimum guaranteed resource= s . By
> default value is 100 implies no user limits are imposed.
>
>
>
> Additionally we can think of
> "yarn.nodemanager.linux-container-executor.cgroups.strict-resourc= e-usage"
> which will enforce strict cpu usage for a given container if required.=
>
>
>
> + Naga
>
>
>
> On Thu, Sep 17, 2015 at 4:42 PM, Laxman Ch <laxman.lux@gmail.com> wrote:
>
> Yes. I'm already using cgroups. Cgroups helps in controlling the r= esources
> at container level. But my requirement is more about controlling the > concurrent resource usage of an application at whole cluster level. >
>
>
> And yes, we do configure queues properly. But, that won't help. >
>
>
> For example, I have an application with a requirement of 1000 vcores. = But, I
> wanted to control this application not to go beyond 100 vcores at any = point
> of time in the cluster/queue. This makes that application to run longe= r even
> when my cluster is free but I will be able meet the guaranteed SLAs of= other
> applications.
>
>
>
> Hope this helps to understand my question.
>
>
>
> And thanks Narasimha for quick response.
>
>
>
> On 17 September 2015 at 16:17, Naganarasimha Garla
> <na= ganarasimha.gr@gmail.com> wrote:
>
> Hi Laxman,
>
> Yes if cgroups are enabled and "yarn.scheduler.capacity.resource-= calculator"
> configured to DominantResourceCalculator then cpu and memory can be > controlled.
>
> Please Kindly=C2=A0 furhter refer to the official documentation
> http://hadoop.apache.org/docs/r1.2.1/capacity_scheduler.html
>
>
>
> But may be if say more about problem then we can suggest ideal
> configuration, seems like capacity configuration and splitting of the = queue
> is not rightly done or you might refer to Fair Scheduler if you want m= ore
> fairness for container allocation for different apps.
>
>
>
> On Thu, Sep 17, 2015 at 4:10 PM, Laxman Ch <laxman.lux@gmail.com> wrote:
>
> Hi,
>
>
>
> In YARN, do we have any way to control the amount of resources (vcores= ,
> memory) used by an application SIMULTANEOUSLY.
>
>
>
> - In my cluster, noticed some large and long running mr-app occupied a= ll the
> slots of the queue and blocking other apps to get started.
>
> - I'm using Capacity schedulers (using hierarchical queues and pre= emption
> disabled)
>
> - Using Hadoop version 2.6.0
>
> - Did some googling around this and gone through configuration docs bu= t I'm
> not able to find anything that matches my requirement.
>
>
>
> If needed, I can provide more details on the usecase and problem.
>
>
>
> --
>
> Thanks,
> Laxman
>
>
>
>
>
>
>
> --
>
> Thanks,
> Laxman
>
>
>
>
>
>
>
> --
>
> Thanks,
> Laxman
>
>
>
>
>
> --
>
> Thanks,
> Laxman



--
Thanks,
Laxman



--
Thanks,
Laxman
--001a113f7a92e4df970520e1084e--