Return-Path: Delivered-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Received: (qmail 12005 invoked from network); 15 Feb 2010 17:59:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2010 17:59:50 -0000 Received: (qmail 90980 invoked by uid 500); 15 Feb 2010 15:13:52 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 90921 invoked by uid 500); 15 Feb 2010 15:13:52 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 90832 invoked by uid 99); 15 Feb 2010 15:13:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Feb 2010 15:13:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Feb 2010 15:13:50 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0C51B29A0014 for ; Mon, 15 Feb 2010 07:13:29 -0800 (PST) Message-ID: <1096468694.279621266246809049.JavaMail.jira@brutus.apache.org> Date: Mon, 15 Feb 2010 15:13:29 +0000 (UTC) From: "Rajesh Balamohan (JIRA)" To: mapreduce-issues@hadoop.apache.org Subject: [jira] Commented: (MAPREDUCE-1495) Reduce locking contention on JobTracker.getTaskCompletionEvents() In-Reply-To: <715422156.278081266239127976.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MAPREDUCE-1495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833834#action_12833834 ] Rajesh Balamohan commented on MAPREDUCE-1495: --------------------------------------------- As of now, its implemented as follows in JobTracker public synchronized TaskCompletionEvent[] getTaskCompletionEvents( JobID jobid, int fromEventId, int maxEvents) throws IOException{ synchronized (this) { JobInProgress job = this.jobs.get(jobid); if (null != job) { if (job.inited()) { return job.getTaskCompletionEvents(fromEventId, maxEvents); } else { return EMPTY_EVENTS; } } } return completedJobStatusStore.readJobTaskCompletionEvents(jobid, fromEventId, maxEvents); } Where, jobs is TreeMap(). It is possible to reduce to contention in 2 ways. 1. Reduce the synch to only JobInProgress job = this.jobs.get(jobid); Rest of the code is independent of the synch block (asaik). 2. Change datastructure of jobs to ConcurrentHashMap(). This way, we can jobs.get(jobid) automatically becomes threadsafe and the total synchornization itself can be eliminated. If its mandatory to maintain the order, I have to try the 1st one. > Reduce locking contention on JobTracker.getTaskCompletionEvents() > ----------------------------------------------------------------- > > Key: MAPREDUCE-1495 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-1495 > Project: Hadoop Map/Reduce > Issue Type: Improvement > Affects Versions: 0.20.1 > Reporter: Rajesh Balamohan > > While profiling JT for slow performance with small-jobs, it was observed that JobTracker.getTaskCompletionEvents() is attributing to 40% of lock contention on JT. > This JIRA ticket is created to explore the possibilities of reducing the sychronized code block in this method. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.