Speculative Execution in Hadoop
来自:http://blog.csdn.net/macyang/article/details/7880671
所谓的推测执行,就是当所有task都开始运行之后,Job Tracker会统计所有任务的平均进度,如果某个task所在的task node机器配置比较低或者CPU load很高(原因很多),导致任务执行比总体任务的平均执行要慢,此时Job Tracker会启动一个新的任务(duplicate task),原有任务和新任务(一个task会有多个attempt同时执行)哪个先执行完就把另外一个kill掉,这也是我们经常在Job Tracker页面看到任务执行成功,但是总有些任务被kill,就是这个原因。另外,根据mapreduce job的特点,同一个task执行多次的结果是一样的,所以task只要有一次执行成功,job就是成功的,被kill的task对job的结果没有影响。
配置参数:
mapred.map.tasks.speculative.execution=true
mapred.reduce.tasks.speculative.execution=true
这两个是推测执行的配置项,当然如果你从来不关心这两个选项也没关系,它们默认值是true
而Hadoop 会根据task progress score决定是否killed一个task:
For a map, the progress score is the fraction of input data read.
For a reduce task, the execution is divided into three phases, each of which accounts for 1/3 of the score:
• The copy phase, when the task fetches map outputs.
• The sort phase, when map outputs are sorted by key.
• The reduce phase, when a user-defined function is applied to the list of map outputs with each key.
In each phase, the score is the fraction of data processed.
For example,
• a task halfway through the copy phase has a progress score of 1 / 2 * 1 / 3 = 1 / 6
• a task halfway through the reduce phase has a progress score of 1 / 3 + 1 / 3 + 1 / 2 * 1 / 3 = 5 / 6
Hadoop looks at the
average progress score of each category of tasks (maps and reduces) to
define a threshold for speculative execution. When a task’s progress
score is less than the average for its category by
a threshold, and the task has run for a certain amount of time, it is
considered slow. The scheduler also ensures that at most one speculative
copy of each task is running at a time. When running multiple jobs,
Hadoop uses a FIFO discipline where the earliest
submitted job is asked for a task to run, then the second, etc. There
is also a priority system for putting jobs into higher-priority queues.
(来源:http://adhoop.wordpress.com/2012/02/24/speculative-execution-in-hadoop/)
Speculative Execution in Hadoop的更多相关文章
- Method and apparatus for speculative execution of uncontended lock instructions
A method and apparatus for executing lock instructions speculatively in an out-of-order processor ar ...
- Hadoop就业面试题
----------------------------------------------------------------------------- [申明:资料来源于互联网] 本文链接:htt ...
- Hadoop(4)MapReduce 任务的推测(speculative)执行
Straggle(掉队者)是指那些跑的很慢但最终会成功完成的任务.一个掉队的Map任务会阻止Reduce任务开始执行. Hadoop不能自动纠正掉队任务,但是可以识别那些跑的比较慢的任务,然后它会产生 ...
- [Hadoop in Action] 第6章 编程实践
Hadoop程序开发的独门绝技 在本地,伪分布和全分布模式下调试程序 程序输出的完整性检查和回归测试 日志和监控 性能调优 1.开发MapReduce程序 [本地模式] 本地模式 ...
- Hadoop笔记HDFS(2)
高级Hadoop MapReduce管理 1 调试部署好的Hadoop的配置 2 运行基准测试检验Hadoop的安装 3 重新利用JVM提升性能 4 容错性 5 调试脚本-分析失败任务原因 6 设置失 ...
- Hadoop随笔(一):工作流程的源码
一.几个可能会用到的属性值 1.mapred.map.tasks.speculative.execution和mapred.reduce.tasks.speculative.execution 这两个 ...
- hadoop MapReduce 笔记
1. MapReduce程序开发步骤 编写map 和 reduce 程序–> 单元测试 -> 编写驱动程序进行验证-> 本地数据集调试 -> 部署到集群运行 用 ...
- 从wordcount 开始 mapreduce (C++\hadoop streaming模式)
序:终于开始接触hadoop了,从wordcount开始 1. 采用hadoop streamming模式 优点:支持C++ pathon shell 等多种语言,学习成本较低,不需要了解hadoop ...
- hadoop可能遇到的问题
1.hadoop运行的原理? 2.mapreduce的原理? 3.HDFS存储的机制? 4.举一个简单的例子说明mapreduce是怎么来运行的 ? 5.面试的人给你出一些问题,让你用mapreduc ...
随机推荐
- Ubntu 14.04 下 开源骨架跟踪-skeltrack
Skeltrack是个不错的开源骨架跟踪软件.跟踪起来还相对的稳定速度还不错.能满足基本的体感功能.下面来介绍下怎么安装. 1.运行环境配置 #need clutter 1.8 or greater ...
- git服务端和客户端百度网盘下载地址
https://pan.baidu.com/s/1BKw-bgYOrQjLkwUMzyH7KQ
- HK设备安全补丁升级方案
1.背景: 当前很多HK行业设备的端口映射到公网上,其中一部分老版本设备是存在安全漏洞的,由于传统行业没有设备平台的概念,无法通过设备提示用户进行升级,导致这些存在漏洞的设备在互联网 ...
- chrome --headless --disable-gpu --dump-dom http://www.python.org
Driving Headless Chrome with Python:Python chrome --headless --disable-gpu --dump-dom http://www.pyt ...
- 【scrapy】使用方法概要(四)(转)
[请初学者作为参考,不建议高手看这个浪费时间] 上一篇文章,我们抓取到了一大批代理ip,本篇文章介绍如何实现downloaderMiddleware,达到随即使用代理ip对目标网站进行抓取的. 抓取的 ...
- fragment和fragmentactivity解析
一.为什么要使用Fragment 1.当我们须要动态的多界面切换的时候,就须要将UI元素和Activity融合成一个模块.在2.3中我们一般通过各种Activity中进行跳转来实现多界面的跳转和单个 ...
- vultr vs digitalocean vs linode
vultr官方网站:www.vultr.comdigitalocean官方网站:www.digitalocean.comlinode官方网站:www.linode.com 一般来说我们买VPS的时候都 ...
- patch补丁命令 P1 P0 P2
http://fancyxinyu.blog.163.com/blog/static/1823213662013719115245699/ http://blog.chinaunix.net/uid- ...
- 启明星产品与微软Active Directory活动目录集成说明
本文介绍启明星Helpdesk系统,如何和微软域集成. (1)确保在集成微软域之前,系统已经能够访问. (2)进入后台,用户管理页面,新加一个账户,此账户需要在微软域里(普通账户即可),然后在角色里设 ...
- Cocos2d-x3.3RC0通过JNI调用Android的Java层URI代码发送短信
1.Jni不在赘述.翻看前面博客 2.直接上代码 1)Java层,直接加在AppActivity.java中 public class AppActivity extends Cocos2dxActi ...