`

hadoop 2.x-HDFS short circuit read

 
阅读更多

  this feature is a considerable performance improvement,as per the idea 'moves the computation to data side',this is a further usage of it.

 

Outline

 1.what is 

 2.how to 

 3.setup to run

 4.one more thinking

 

1.what is

  about ten years ago,i usually heard some ad words,maybe belong  of intell,"the technology of moving computation".of course ,hadoop,uses it as one of the key features to advance hdfs reads:read on local node.u will see some info like "Launched local maps" from the results of issuing a job.

  or,maybe u will occur similar scenarios like rebuilding indexes from hbase by MR,and u want to index to local host directly by local fs without crossing the solr webserver if the maps are co-located in the same node with solr .sure,if u adjust the map slots to one per node,this will run fine,else that will cause multi-threads competition.

  in the opposite direction of data stream with front case,the so called 'short circuit reads' is issued by mr mappers,and the datanode lied in same host is hardly to do  nothing:maybe only pass file descirptiors etc,and most part of reading files are based on client to act on,so this maybe say that 'reading data without crossing datanode'.so something costs like threads usage,tcp sockets are eliminated by client to increase performance.

  

 2.how to 

  through comaring the three modes of reading data ,then will get a clear impress

mode target version data-flow cache other features safe protection on local files
common tcp

before 1.0 or

before 0.23.1

local datanode->client - hdfs build-in before 1.x y
hdfs-2246(short circuit reads ) 1.x,0.23.1+ read local directly without dn block path

complex to setup,

through changing user attributes and data dir permissions;

pass file offset ,length etc to client,then the later reas file using them

n,but can be fixed by setuping some properties

hdfs-347(short circuit reads with secure) 2.10-beta read local directly without dn file descriptor (higheffect)

simple to setup;

using system domain socket to pass fd[1]

y,passing fd only without other fils needed not

           

 

 

 3.setup to run

  here are some properties in hdfs-site.xml from setuping a hdfs-347 configs,check it here for hdfs-2246

<!--short circuit read -->
<property>
    <name>dfs.client.read.shortcircuit</name>
    <value>true</value>
</property>
<property>
    <name>dfs.domain.socket.path</name>
    <value>/usr/local/hadoop/data-2.5.1/dfs_dn_socket</value>
</property>

    so the last hdfs-347 is more effective and safe,from my test,this is the result from reading 1 GB file from hdfs

 

time hadoop fs -get /user/tmp.dd 2
  tcp:33s

 

  hdfs-347:31s

  yes,this is not obvious,as the bottleneck of the test is stuck on suboptimal hard disk.but u see, the difference between them is also reasonable.

 

 

 4.one more thinking

  in according to current common hard-disks(not ssd),if enable short circuit reads,may be broken the io trade off if some other services are deployed in same cluster since this feature will swallow nearly all the io resouces?maybe 

 

 

 

Ref:

[1]http://troydhanson.github.io/misc/Unix_domain_sockets.html

HDFS Short-Circuit Local Reads

How Improved Short-Circuit Local Reads Bring Better Performance and Security to Hadoop

jira of this topic

 

 

分享到:
评论

相关推荐

    hadoop-common-2.2.0-bin

    6. **性能优化**:理解并使用Hadoop的缓存策略,如短路读(Short-Circuit Read)和本地化读(Local Read),可以显著提高数据读取速度。 总之,Hadoop Common 2.2.0是Hadoop生态系统中的重要组成部分,为Hadoop的...

    hadoop3.1.4参数默认配置项

    - **dfs.client.read.shortcircuit**:如果启用,客户端可以直接从DataNode读取数据,提高性能。 3. **mapred-default.xml**: MapReduce框架的配置。 - **mapreduce.framework.name**:默认为yarn,表示...

    hadoop 默认配置大全

    此外,还有关于块大小(`dfs.blocksize`)、客户端缓存(`dfs.client.read.shortcircuit`)等设置。 `mapred-default.xml`是MapReduce框架的默认配置。MapReduce负责分布式任务的执行,包括Mapper和Reducer阶段。`...

    hadoop-1.1.1

    还有一些优化策略,如短路读(Short-Circuit Read)和本地读(Local Read),可进一步提高数据读取速度。 8. **安全性**: 虽然Hadoop 1.x版本的安全性相对较弱,但可以通过添加SASL(Simple Authentication and ...

    Impala安装,亲测

    &lt;name&gt;dfs.client.read.shortcircuit.skip.checksum &lt;value&gt;false ``` 在 `hdfs-site.xml` 文件中,需要增加以下配置信息: ``` &lt;name&gt;dfs.datanode.hdfs-blocks-metadata.enabled &lt;value&gt;true &lt;name&gt;dfs....

    hadoop-2.6-configuration:hadoop 2.6 多集群配置文件

    - 使用`dfs.client.read.shortcircuit`和`dfs.domain.socket.path`启用HDFS短路读,减少网络延迟。 9. **监控与日志管理**: - `dfs.namenode.logging.level`和`dfs.datanode.logging.level`调整NameNode和...

    2HDFS 调优篇.zip

    - **dfs.client.read.shortcircuit**:启用短路读,直接从本地DataNode读取数据,减少网络延迟。 - **dfs.replication**:设置全局副本系数。 - **dfs.blocksize**:设定默认块大小。 - **dfs.datanode.handler....

    dadoop2.7win版本

    - HDFS的性能优化,如Block Size调整、Short Circuit Read等,提升了读写速度。 - 更强的稳定性和安全性,包括加密和访问控制列表的增强。 3. **Windows上的Hadoop安装** - 解压缩:首先,你需要下载并解压提供...

    hadoop搭建配置文件

    4. `dfs.client.read.shortcircuit`:如果开启,客户端可以直接从DataNode读取数据,而无需通过NameNode,从而提高性能。 接下来,`core-site.xml`文件包含了Hadoop整体的通用配置,如: 1. `fs.defaultFS`:设定...

    hdfs资料整理

    为了提高性能,可以进行一系列优化,如调整副本数、设置合适的块大小、利用短路读(Short-Circuit Read)等。同时,监控HDFS的性能指标,如磁盘利用率、数据节点健康状况等,也是运维过程中的重要环节。 9. **安全...

    Hadoop分布式文件系统的文件读写

    3. **缓存策略**:通过设置`dfs.client.read.shortcircuit`等参数,启用短路读取和数据本地化策略,提高读取速度。 4. **负载均衡**:定期运行`hadoop balancer`命令,确保DataNodes间的磁盘空间均衡。 通过以上对...

    HDFS及优化综述_朱紫钰_20192622781

    4. 通信优化:通过调整网络拓扑、使用短路读取(Short-Circuit Read)减少通信延迟,或者利用RDMA(远程直接内存访问)技术提高带宽利用率。 【总结】 HDFS是大数据处理的关键组件,通过其特有的架构和压缩算法...

    HBase性能优化指南

    通过`dfs.client.read.shortcircuit=true`启用短路读取,并适当设置缓冲区大小`dfs.client.read.shortcircuit.buffer.size`。 - **其他HDFS设置**: - 为了防止在出现故障的数据节点上进行读写操作,可以设置`dfs....

    Hadoop上Data Locality的详解

    - 调整Hadoop配置参数,如`mapred.local.map.tasks`和`dfs.client.read.shortcircuit`等,以鼓励本地执行。 - 使用YARN的Resource Manager和Scheduler特性,如Fair Scheduler或Capacity Scheduler,这些调度器可以...

    Spark SQL 在字节跳动的优化实践-郭俊

    - **与Hadoop的交互**:优化HDFS读写操作,如使用Hadoop的Short Circuit Read技术减少网络传输。 - **与Hive的兼容**:利用Hive Metastore服务,共享元数据,减少重复计算。 5. **监控与调优工具** - **使用...

Global site tag (gtag.js) - Google Analytics