Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D384DBDB for ; Wed, 17 Oct 2012 15:40:04 +0000 (UTC) Received: (qmail 88603 invoked by uid 500); 17 Oct 2012 15:40:04 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 88537 invoked by uid 500); 17 Oct 2012 15:40:04 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 88473 invoked by uid 99); 17 Oct 2012 15:40:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Oct 2012 15:40:03 +0000 Date: Wed, 17 Oct 2012 15:40:03 +0000 (UTC) From: "Uma Maheswara Rao G (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <1769909356.58153.1350488403943.JavaMail.jiratomcat@arcas> In-Reply-To: <2068633031.57115.1350472083793.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (HDFS-4070) DFSClient ignores bufferSize argument & always performs small writes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-4070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477963#comment-13477963 ] Uma Maheswara Rao G commented on HDFS-4070: ------------------------------------------- Gopal, I agree, we are ignoring the buffer size. also I have seen similar/same issue HDFS-3953 But we have a configured property to increase packet size right? {code} public static final String DFS_CLIENT_WRITE_PACKET_SIZE_KEY = "dfs.client-write-packet-size"; public static final int DFS_CLIENT_WRITE_PACKET_SIZE_DEFAULT = 64*1024; {code} are you suggesting that, use user provided buffer instead of packetsize configured? could you please clarify? And yes, having more smaller writes can hit the disk iops overhead, as we will allow concurrent disk writes. Worth revisiting the default sizes as Suresh suggested. > DFSClient ignores bufferSize argument & always performs small writes > -------------------------------------------------------------------- > > Key: HDFS-4070 > URL: https://issues.apache.org/jira/browse/HDFS-4070 > Project: Hadoop HDFS > Issue Type: Bug > Components: hdfs client > Affects Versions: 1.0.3, 2.0.3-alpha > Environment: RHEL 5.5 x86_64 (ec2) > Reporter: Gopal V > Priority: Minor > > The following code illustrates the issue at hand > {code} > protected void map(LongWritable offset, Text value, Context context) > throws IOException, InterruptedException { > OutputStream out = fs.create(new Path("/tmp/benchmark/",value.toString()), true, 1024*1024); > int i; > for(i = 0; i < 1024*1024; i++) { > out.write(buffer, 0, 1024); > } > out.close(); > context.write(value, new IntWritable(i)); > } > {code} > This code is run as a single map-only task with an input file on disk and map-output to disk. > {{# su - hdfs -c 'hadoop jar /tmp/dfs-test-1.0-SNAPSHOT-job.jar file:///tmp/list file:///grid/0/hadoop/hdfs/tmp/benchmark'}} > In the data node disk access patterns, the following consistent pattern was observed irrespective of bufferSize provided. > {code} > 21119 read(58, > 21119 <... read resumed> "\0\1\0\0\0\0\0\0\0034\212\0\0\0\0\0\0\0+\220\0\0\0\376\0\262\252ux\262\252u"..., 65557) = 65557 > 21119 lseek(107, 0, SEEK_CUR > 21119 <... lseek resumed> ) = 53774848 > 21119 write(107, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65024 > 21119 <... write resumed> ) = 65024 > 21119 write(108, "\262\252ux\262\252ux\262\252ux\262\252ux\262\252ux\262\252ux\262\252ux\262\252ux"..., 508 > 21119 <... write resumed> ) = 508 > {code} > Here fd 58 is the incoming socket, 107 is the blk file and 108 is the .meta file. > The DFS packet size ignores the bufferSize argument and suffers from suboptimal syscall & disk performance because of the default 64kb value, as is obvious from the interrupted read/write operations. > Changing the packet size to a more optimal 1056405 bytes results in a decent spike in performance, by cutting down on disk & network iops. > h3. Average time (milliseconds) for a 10 GB write as 10 files in a single map task > ||timestamp||65536||1056252|| > |1350469614|88530|78662| > |1350469827|88610|81680| > |1350470042|92632|78277| > |1350470261|89726|79225| > |1350470476|92272|78265| > |1350470696|89646|81352| > |1350470913|92311|77281| > |1350471132|89632|77601| > |1350471345|89302|81530| > |1350471564|91844|80413| > That is by average an increase from ~115 MB/s to ~130 MB/s, by modifying the global packet size setting. > This suggests that there is value in adapting the user provided buffer sizes to hadoop packet sizing, per stream. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira