一、优化的点

  • Reduce Task Number
  • Map Task输出压缩
  • Shuffle Phase 参数
  • map、reduce分配的虚拟CPU

二、Reduce Task Number

Reduce Task 默认是一个;

Reduce Task的数目也不是越多越好,实际中需要测试调整,以调整到最优的个数, 如下;

job.setNumReduceTasks(2);

 

三、Map Task输出压缩

上一节已经讲到了;

四、Shuffle Phase 参数

具体可参考:mapred-default.xml

可调的有如下几点:

mapreduce.task.io.sort.factor:

<property>
<name>mapreduce.task.io.sort.factor</name>
<value>10</value>
<description>The number of streams to merge at once while sorting
files. This determines the number of open file handles.</description>
</property>

mapreduce.task.io.sort.mb:

<property>
<name>mapreduce.task.io.sort.mb</name>
<value>100</value>
<description>The total amount of buffer memory to use while sorting
files, in megabytes. By default, gives each merge stream 1MB, which
should minimize seeks.</description>
</property>

mapreduce.map.sort.spill.percent:

<property>
<name>mapreduce.map.sort.spill.percent</name>
<value>0.80</value>
<description>The soft limit in the serialization buffer. Once reached, a
thread will begin to spill the contents to disk in the background. Note that
collection will not block if this threshold is exceeded while a spill is
already in progress, so spills may be larger than this threshold when it is
set to less than .5</description>
</property>

五、map、reduce分配的虚拟CPU

默认都是一个虚拟CPU,实际中也可以调整;

1、map

mapreduce.map.cpu.vcores:

<property>
<name>mapreduce.map.cpu.vcores</name>
<value>1</value>
<description>
The number of virtual cores required for each map task.
</description>
</property>

2、reduce

mapreduce.reduce.cpu.vcores:

<property>
<name>mapreduce.reduce.cpu.vcores</name>
<value>1</value>
<description>
The number of virtual cores required for each reduce task.
</description>
</property>

最新文章

  1. Latex中画出函数文件的调用关系拓扑图
  2. 在此为LCT开一个永久的坑
  3. java 存储对象
  4. 每天一个linux命令---kill
  5. (Python)导出指定文件夹中as文件的完全限定类名
  6. oracle10g如何配置客户端
  7. java下tcp的socket连接
  8. ES6 let和const命令
  9. 字符串在 UNICODE、MBCS编码下面的区别
  10. div光标定位问题总结
  11. 洛谷-A+B Problem-洛谷的第一个任务
  12. Spark 的combineByKey函数
  13. 前端面试题整理—Webpack篇
  14. layui laydate is not defined
  15. mysql主从模式下在主库上的某些操作不记录日志的方法
  16. P2709 小B的询问(莫队入门)
  17. bzoj 4459: [Jsoi2013]丢番图 -- 数学
  18. JDK官网下载教程
  19. 【机器学习】K近邻算法——多分类问题
  20. WC游记

热门文章

  1. 【postman】安装使用说明
  2. win7安装ANT
  3. linux find 命令查找 复制
  4. Linux C++的多线程编程(转)
  5. 第一次OllyDbg逆向记录(分析思路和注意点&amp;其他文章)
  6. mac的终端窗口的工作组的使用
  7. 合肥 专业做APP(安卓,ios) 微信公共平台
  8. OPENCV在ARM平台的移植
  9. (linux)platform_driver_probe与platform_driver_register的区别
  10. ReactNative Android 研究