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 04A2C200CB4 for ; Tue, 27 Jun 2017 18:54:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 02FDE160BF9; Tue, 27 Jun 2017 16:54:06 +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 492D5160BD8 for ; Tue, 27 Jun 2017 18:54:05 +0200 (CEST) Received: (qmail 13059 invoked by uid 500); 27 Jun 2017 16:54:03 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 13047 invoked by uid 99); 27 Jun 2017 16:54:03 -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; Tue, 27 Jun 2017 16:54:03 +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 2D35C188A5A for ; Tue, 27 Jun 2017 16:54:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id latwiUrHlEjV for ; Tue, 27 Jun 2017 16:54:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 231595FBBA for ; Tue, 27 Jun 2017 16:54:01 +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 5E7A0E03EE for ; Tue, 27 Jun 2017 16:54:00 +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 1C33124120 for ; Tue, 27 Jun 2017 16:54:00 +0000 (UTC) Date: Tue, 27 Jun 2017 16:54:00 +0000 (UTC) From: "Haibo Chen (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MAPREDUCE-6647) MR usage counters use the resources requested instead of the resources allocated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 27 Jun 2017 16:54:06 -0000 [ https://issues.apache.org/jira/browse/MAPREDUCE-6647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16065122#comment-16065122 ] Haibo Chen commented on MAPREDUCE-6647: --------------------------------------- Thanks for pointing this out [~vrushalic]! I agree this will change what downstream apps see. But the change is not modifying the counter to report what the actual usage is. What it does is that it changes resource requested by tasks to actual resource allocation by YARN, i.e. how much resource was actually reserved for the job. The bug we were trying to fix is that if a map task requires 1GB to run, and somehow the minimum allocation of the cluster is set to 2GB, the cluster will actually reserve 2GB for the task. Can you please elaborate a little more on how downstream apps make use of these counters? Anyway, I think we should revert this from branch-2. [~rkanter] Thoughts? > MR usage counters use the resources requested instead of the resources allocated > -------------------------------------------------------------------------------- > > Key: MAPREDUCE-6647 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-6647 > Project: Hadoop Map/Reduce > Issue Type: Bug > Reporter: Haibo Chen > Assignee: Haibo Chen > Fix For: 2.9.0, 3.0.0-alpha1 > > Attachments: mapreduce6647.001.patch, mapreduce6647.002.patch, mapreduce6647.003.patch, mapreduce6647.004.patch > > > As can be seen in the following snippet, the MR counters for usage use the resources requested instead of the resources allocated. The scheduler increment-allocation-mb configs could lead to these values not being the same. We could change the counters to use the allocated resources in order to account for this. > {code} > private static void updateMillisCounters(JobCounterUpdateEvent jce, > TaskAttemptImpl taskAttempt) { > /***omitted**/ > long duration = (taskAttempt.getFinishTime() - taskAttempt.getLaunchTime()); > int mbRequired = > taskAttempt.getMemoryRequired(taskAttempt.conf, taskType); > int vcoresRequired = taskAttempt.getCpuRequired(taskAttempt.conf, taskType); > int minSlotMemSize = taskAttempt.conf.getInt( > YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, > YarnConfiguration.DEFAULT_RM_SCHEDULER_MINIMUM_ALLOCATION_MB); > int simSlotsRequired = > minSlotMemSize == 0 ? 0 : (int) Math.ceil((float) mbRequired > / minSlotMemSize); > if (taskType == TaskType.MAP) { > jce.addCounterUpdate(JobCounter.SLOTS_MILLIS_MAPS, simSlotsRequired * duration); > jce.addCounterUpdate(JobCounter.MB_MILLIS_MAPS, duration * mbRequired); > jce.addCounterUpdate(JobCounter.VCORES_MILLIS_MAPS, duration * vcoresRequired); > jce.addCounterUpdate(JobCounter.MILLIS_MAPS, duration); > } else { > jce.addCounterUpdate(JobCounter.SLOTS_MILLIS_REDUCES, simSlotsRequired * duration); > jce.addCounterUpdate(JobCounter.MB_MILLIS_REDUCES, duration * mbRequired); > jce.addCounterUpdate(JobCounter.VCORES_MILLIS_REDUCES, duration * vcoresRequired); > jce.addCounterUpdate(JobCounter.MILLIS_REDUCES, duration); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org