分享

为什么hadoop基准测试写入的结果和使用hdfs api上传结果 有差距

wdx_827 发表于 2017-8-14 11:38:10 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 1 5850
万兆网络,使用TestDFSIO -write-nrFiles 10 -fileSize 1024 ,结果为average IO rate mb/sec:72.4 72.4*10=720m/s,另外我用hdfs的api,多个线程并发上传1G文件,带宽最高就560m/s,不知道什么原因。
api上传文件我试过了三种方式:
1.
FSDataOutputStream output = null;
Path destPath = getPath(dest);
if(!dfs.exists(destPath))
dfs.mkdirs(destPath);
Path sourPath = new Path(sour);
dfs.copyFromLocalFile(sourPath, destPath);

2.
FSDataOutputStream output = null;
Path f = getPath(path);
output = dfs.create(f);
FileUtils.copyFile(file, output);

3.
FSDataOutputStream output = null;
                        Path f = getPath(path);
                        output = dfs.create(f);
                        IOUtils.copyBytes(in, output, 1024 * 8, false);


已有(1)人评论

跳转到指定楼层
qcbb001 发表于 2017-8-14 12:24:07
有些差距正常的,应该数据的多少,集群的当时的资源,mapreduce任务数,还有测试软件。这些都有关系的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条