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 4DF1A200B92 for ; Wed, 24 Aug 2016 03:06:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4CC39160ABF; Wed, 24 Aug 2016 01:06:22 +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 9012D160AAD for ; Wed, 24 Aug 2016 03:06:21 +0200 (CEST) Received: (qmail 59415 invoked by uid 500); 24 Aug 2016 01:06:20 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 59396 invoked by uid 99); 24 Aug 2016 01:06:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Aug 2016 01:06:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8E6DC2C014E for ; Wed, 24 Aug 2016 01:06:20 +0000 (UTC) Date: Wed, 24 Aug 2016 01:06:20 +0000 (UTC) From: "Xiaoyu Yao (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10690) Optimize insertion/removal of replica in ShortCircuitCache.java MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 24 Aug 2016 01:06:22 -0000 [ https://issues.apache.org/jira/browse/HDFS-10690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15433988#comment-15433988 ] Xiaoyu Yao commented on HDFS-10690: ----------------------------------- bq. I'll write a micro benchmark to compare LinkedMap with TreeMap and get back to you. We have a lot of variations here: key, hash function, percentage of insert/delete/lookup operations, etc. There are quite some micro benchmark for TreeMap/LinkedHashMap(similar to LinkedMap from apache common) if you search online. Instead of tuning the parameter to simulate the workloads with micro benchmark, I would suggest we run the same YCSB benchmark with the last patch using LinkedMap for easy comparison. > Optimize insertion/removal of replica in ShortCircuitCache.java > --------------------------------------------------------------- > > Key: HDFS-10690 > URL: https://issues.apache.org/jira/browse/HDFS-10690 > Project: Hadoop HDFS > Issue Type: Improvement > Components: hdfs-client > Affects Versions: 3.0.0-alpha2 > Reporter: Fenghua Hu > Assignee: Fenghua Hu > Attachments: HDFS-10690.001.patch, HDFS-10690.002.patch, ShortCircuitCache_LinkedMap.patch > > Original Estimate: 336h > Remaining Estimate: 336h > > Currently in ShortCircuitCache, two TreeMap objects are used to track the cached replicas. > private final TreeMap evictable = new TreeMap<>(); > private final TreeMap evictableMmapped = new TreeMap<>(); > TreeMap employs Red-Black tree for sorting. This isn't an issue when using traditional HDD. But when using high-performance SSD/PCIe Flash, the cost inserting/removing an entry becomes considerable. > To mitigate it, we designed a new list-based for replica tracking. > The list is a double-linked FIFO. FIFO is time-based, thus insertion is a very low cost operation. On the other hand, list is not lookup-friendly. To address this issue, we introduce two references into ShortCircuitReplica object. > ShortCircuitReplica next = null; > ShortCircuitReplica prev = null; > In this way, lookup is not needed when removing a replica from the list. We only need to modify its predecessor's and successor's references in the lists. > Our tests showed up to 15-50% performance improvement when using PCIe flash as storage media. > The original patch is against 2.6.4, now I am porting to Hadoop trunk, and patch will be posted soon. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org