Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CBA85200C1E for ; Fri, 17 Feb 2017 23:02:18 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CA3C6160B6D; Fri, 17 Feb 2017 22:02:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1D7A8160B46 for ; Fri, 17 Feb 2017 23:02:17 +0100 (CET) Received: (qmail 65722 invoked by uid 500); 17 Feb 2017 22:02:17 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 65710 invoked by uid 99); 17 Feb 2017 22:02:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Feb 2017 22:02:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A91A91857AE for ; Fri, 17 Feb 2017 22:02:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id q-wHzvXldeOS for ; Fri, 17 Feb 2017 22:02:16 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A8A645F238 for ; Fri, 17 Feb 2017 22:02:15 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D7D46E081B for ; Fri, 17 Feb 2017 22:01:44 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5654124129 for ; Fri, 17 Feb 2017 22:01:44 +0000 (UTC) Date: Fri, 17 Feb 2017 22:01:44 +0000 (UTC) From: "Yufei Gu (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (YARN-4691) Cache resource usage at FSLeafQueue level MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 17 Feb 2017 22:02:19 -0000 [ https://issues.apache.org/jira/browse/YARN-4691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yufei Gu resolved YARN-4691. ---------------------------- Resolution: Duplicate > Cache resource usage at FSLeafQueue level > ----------------------------------------- > > Key: YARN-4691 > URL: https://issues.apache.org/jira/browse/YARN-4691 > Project: Hadoop YARN > Issue Type: Improvement > Reporter: Ming Ma > Assignee: Yufei Gu > > As part of the fair share assignment, fair scheduler needs to sort queues to decide which queue is furthest away from its fair share. During the sorting, the comparator needs to get the Resource usage of each queue. > The parent queue will aggregate the resource usage from leaf queues. The leaf queue will aggregate the resource usage from all apps in the queue. > {noformat} > FSLeafQueue.java > @Override > public Resource getResourceUsage() { > Resource usage = Resources.createResource(0); > readLock.lock(); > try { > for (FSAppAttempt app : runnableApps) { > Resources.addTo(usage, app.getResourceUsage()); > } > for (FSAppAttempt app : nonRunnableApps) { > Resources.addTo(usage, app.getResourceUsage()); > } > } finally { > readLock.unlock(); > } > return usage; > } > {noformat} > Each time fair scheduler tries to assign a container, it needs to sort all queues. Thus the number of Resources.addTo operations will be (number_of_queues) * lg(number_of_queues) * number_of_apps_per_queue, or number_of_apps_on_the_cluster * lg(number_of_queues). > One way to solve this is to cache the resource usage at FSLeafQueue level. Each time fair scheduler updates FSAppAttempt's resource usage, it will update FSLeafQueue resource usage. This will greatly reduce the overall number of Resources.addTo operations. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org