Return-Path: X-Original-To: apmail-hadoop-yarn-dev-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 114CD10164 for ; Sun, 9 Nov 2014 10:50:46 +0000 (UTC) Received: (qmail 65379 invoked by uid 500); 9 Nov 2014 10:50:45 -0000 Delivered-To: apmail-hadoop-yarn-dev-archive@hadoop.apache.org Received: (qmail 65311 invoked by uid 500); 9 Nov 2014 10:50:45 -0000 Mailing-List: contact yarn-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-dev@hadoop.apache.org Delivered-To: mailing list yarn-dev@hadoop.apache.org Received: (qmail 65298 invoked by uid 99); 9 Nov 2014 10:50:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Nov 2014 10:50:45 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anytek88@gmail.com designates 209.85.220.48 as permitted sender) Received: from [209.85.220.48] (HELO mail-pa0-f48.google.com) (209.85.220.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Nov 2014 10:50:17 +0000 Received: by mail-pa0-f48.google.com with SMTP id ey11so6352209pad.21 for ; Sun, 09 Nov 2014 02:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=J6iBUolKKOeY5TJ+qGIZim7MMe5aN13SzzUvKoPOKNI=; b=BPWp9Cyd0M14MR78GvFv1UTi3XOdJ1JZTE3OIHzylaGQGru+RV5cisVAX7XAXCSG5g J0z0Of3LkqzqIgFf3+Kpf4DiiZpk8NrmIHGP5fuM76zWNQNNUTRhLsAmopN2VEzQPg9Y Epg4zzgIBPdq6EAipmEvR1IiEFtvOKCERIE0ug/IIYNuK19d9L7of6PYqKoSQzBA548j dFpu/Ft0RQKon1x9+A9nOJSTjy69UWDy/j3qRiYaY6E1i9URnk1+nfNXwFO8TlbgmNQz N683/fOs2qxEN9u2rfTgDohkYHqJdfn9M1myrdDiNl4w1ZXdJc4tIe/Bbl5LjjiAz9F/ eegQ== X-Received: by 10.70.90.45 with SMTP id bt13mr24714525pdb.111.1415530216510; Sun, 09 Nov 2014 02:50:16 -0800 (PST) Received: from [192.168.1.103] ([27.3.192.30]) by mx.google.com with ESMTPSA id g8sm9074900pdn.80.2014.11.09.02.50.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Nov 2014 02:50:15 -0800 (PST) Message-ID: <545F46E4.3030700@gmail.com> Date: Sun, 09 Nov 2014 11:50:12 +0100 From: Fabio User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: yarn-dev@hadoop.apache.org Subject: CS code for container allocation policy + a possible inefficiency Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi guys, while exploring the capacity scheduler source code I am having some troubles understanding which is the policy behind container allocation. As I see in org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.LeafQueue it seems that for every app (with pending resource requests) and for every priority (under which we actually have requests) the scheduler will allocate a *single* container, then moving on in the iteration. This sounds very strange to me, since in this way we don't try to satisfy all the highest priority requests for the given app before moving on, nonetheless this is what happens since I don't see any kind of iteration that tries to allocate all the containers required by a ResourceRequest at a given priority. For example, for a given app, if I have a request for n>1 containers at the highest priority (as an instance of org.apache.hadoop.yarn.api.records.ResourceRequest), the path of calls to the procedures required to allocate a container is invoked just once, so the next container will be allocated for a lower priority request. Did I miss a "WHILE there are enough available resources and ResourceRequest.getNumContainers()>0, DO allocate a container" or what else? Could anyone point me to the code implementing this? Furthermore, isn't it quite inefficient to allocate resources in this way? Basically we are allocating resources to applications in order of application submission (they are ordered according to their ID). But in this way, if I submit an application when hundreds of other apps are running in the same leaf queue, my requests will never be served as long as any other app is requiring even just a few resources (despite these requests may be submitted after mine). I thought that the "FIFO order within a leaf queue" means that requests (and not applications) are served in FIFO order. Isn't this last interpretation more reasonable? Is there any reason behind the actual implementation? Regards Fabio