Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 81463 invoked from network); 10 Jun 2008 13:47:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jun 2008 13:47:07 -0000 Received: (qmail 50757 invoked by uid 500); 10 Jun 2008 13:47:08 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 50612 invoked by uid 500); 10 Jun 2008 13:47:08 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 50601 invoked by uid 99); 10 Jun 2008 13:47:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jun 2008 06:47:08 -0700 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; Tue, 10 Jun 2008 13:46:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2A634234C135 for ; Tue, 10 Jun 2008 06:46:45 -0700 (PDT) Message-ID: <1849953409.1213105605172.JavaMail.jira@brutus> Date: Tue, 10 Jun 2008 06:46:45 -0700 (PDT) From: "Brice Arnould (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-3524) JobTracker's processHeartbeat() should not call System.currentTimeMillis() everytime In-Reply-To: <2137912740.1213088985469.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-3524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603871#action_12603871 ] Brice Arnould commented on HADOOP-3524: --------------------------------------- > I ran Brice's test and following are the results OK, I must have misunderstood something. I'm going to explain my understing of this subject, but it's likely that I missed something. Anyway, we'll see ^_^ A first thing is that my tests do not compare the time of both approaches, but the time needed to call currentTimeMillis to the time needed to access a field. And it was more "for fun", because my impressions is that currentTimeMillis() already takes a negligible time. Even if we could make it to take 0 picoseconds, we would spare about 14ms every 10000 calls. That, is arround 14ms every 1 minute and 16 seconds, at the extreme rate of 130 request by second. And that is the extreme situation. There is a need to make things more parallel in the JobTracker, but in my opinion currentTimeMillis() do not worth it. That being said, I probably missed something :-P > JobTracker's processHeartbeat() should not call System.currentTimeMillis() everytime > ------------------------------------------------------------------------------------ > > Key: HADOOP-3524 > URL: https://issues.apache.org/jira/browse/HADOOP-3524 > Project: Hadoop Core > Issue Type: Improvement > Components: mapred > Reporter: Amar Kamat > Attachments: CurrentTimeCost.java > > > Consider the following > {code:title=JobTracker.java|borderStyle=solid} > private synchronized boolean processHeartbeat( > TaskTrackerStatus trackerStatus, boolean initialContact) { > String trackerName = trackerStatus.getTrackerName(); > trackerStatus.setLastSeen(System.currentTimeMillis()); > {code} > Here, the call to {{System.currentTimeMillis()}} on every call to {{JobTracker.processHeartbeat()}} might prove costly. While testing/benchmarking HADOOP-2119, we recorded that the JobTracker was able to serve ~130 tasks/sec. So that means we might make ~130 calls to {{System.currentTimeMillis()}} per second. I think in these cases (_last-seen-status_ etc) such a high level of accuracy in terms of timestamp is unnecessary and hence can be avoided. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.