From hdfs-issues-return-256047-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Mar 12 14:53:05 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4084E180784 for ; Tue, 12 Mar 2019 15:53:05 +0100 (CET) Received: (qmail 90002 invoked by uid 500); 12 Mar 2019 14:53:04 -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 89991 invoked by uid 99); 12 Mar 2019 14:53:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Mar 2019 14:53:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BCFFBC689D for ; Tue, 12 Mar 2019 14:53:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id m_K9yNiQp1bS for ; Tue, 12 Mar 2019 14:53:02 +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 395976125E for ; Tue, 12 Mar 2019 14:53:02 +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 4BA5DE0158 for ; Tue, 12 Mar 2019 14:53:01 +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 AD83F245A0 for ; Tue, 12 Mar 2019 14:53:00 +0000 (UTC) Date: Tue, 12 Mar 2019 14:53:00 +0000 (UTC) From: "David Mollitor (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-14295) Add Threadpool for DataTransfers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-14295?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] David Mollitor updated HDFS-14295: ---------------------------------- Status: Patch Available (was: Open) > Add Threadpool for DataTransfers > -------------------------------- > > Key: HDFS-14295 > URL: https://issues.apache.org/jira/browse/HDFS-14295 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode > Affects Versions: 3.2.0 > Reporter: David Mollitor > Assignee: David Mollitor > Priority: Major > Attachments: HDFS-14295.1.patch, HDFS-14295.2.patch, HDFS-14295.3= .patch, HDFS-14295.4.patch, HDFS-14295.5.patch, HDFS-14295.6.patch, HDFS-14= 295.7.patch, HDFS-14295.8.patch, HDFS-14295.9.patch > > > When a DataNode data transfers a block, is spins up a new thread for each= transfer.=C2=A0 [Here|https://github.com/apache/hadoop/blob/trunk/hadoop-h= dfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanod= e/DataNode.java#L2339] and [Here|https://github.com/apache/hadoop/blob/trun= k/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/serv= er/datanode/DataNode.java#L3019-L3022].=C2=A0 Instead, add the threads to = a=C2=A0{{CachedThreadPool}} so that when their threads complete the transfe= r, they can be re-used for another transfer. This should save resources spe= nt on creating and spinning up transfer threads. > One thing I'll point out that's a bit off, which I address in this patch,= ... > There are two places in the code where a {{DataTransfer}}=C2=A0thread is = started. In [one place|https://github.com/apache/hadoop/blob/trunk/hadoop-h= dfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanod= e/DataNode.java#L2339-L2341], it's started in a default thread group. In [a= nother place|https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-projec= t/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode= .java#L3019-L3022], it's started in the [dataXceiverServer|https://github.c= om/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/o= rg/apache/hadoop/hdfs/server/datanode/DataNode.java#L1164] thread group. > I do not think it's correct to include any of these threads in the {{data= XceiverServer}} thread group. Anything submitted to the {{dataXceiverServer= }} should probably be tied to the {{dfs.datanode.max.transfer.threads}} con= figurations, and neither of these methods are. Instead, they should be subm= itted into the same thread pool with its own thread group (probably the def= ault thread group, unless someone suggests otherwise) and is what I have in= cluded in this patch. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org