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-de?ned 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
de?ne 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

时间: 2024-10-26 19:16:44

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 are disclosed. In one embodiment, a prediction is made whether a given lock instruction will actually be contended. If not, then the lock instruction ma

Hadoop中的Speculative Task调度策略

一:背景 Speculative Task,又叫推测式任务,是指在分布式集群环境下,因为程序bug,负载不均衡或者资源分布不均,造成同一个job多个task运行速度不不一致,有的task运行速度明显要慢于其他task(比如:一个job的某个task进度只有10%,而其他所有task已经运行完毕),则这些task拖慢了了作业的整体执行进度,为了避免这种情况发生,Hadoop会为该task启动Speculative task,让该Speculative task与原始task同时运行,哪个先运行完,

[Hadoop]数据复制DistCp

1.需求 我们项目中需要复制一个大文件,最开始使用的是hadoop cp命令,但是随着文件越来越大,拷贝的时间也水涨船高.下面进行hadoop cp与hadoop distcp拷贝时间上的一个对比.我们将11.9G的文件从data_group/adv/day=20170116下所有文件复制到tmp/data_group/adv/day=20170116/文件下 1.1 查看文件大小 hadoop fs -du -s -h data_group/adv/day=20170116 11.9 G da

Hadoop平台优化

一:概述 随着企业要处理的数据量越来越大,MapReduce思想越来越受到重视.Hadoop是MapReduce的一个开源实现,由于其良好的扩展性和容错性,已经得到越来越广泛的应用. 二:存在问题: Hadoop作为一个基础数据处理平台,虽然其应用价值已经得到大家认可,但仍然存在问题,以下是主要几个: 1:Namenode/jobtracker单点故障 Hadoop采用的是master/slaves架构,该架构管理起来比较简单,但存在致命的单点故障和空间容量不足等缺点,这已经严重影响了Hadoo

Hadoop调优参数总结

Map端调优参数 属性名称 类型 默认值 说明 io.sort.mb int 100 排序map输出时所使用的内存缓冲区大小,以M为单位.当节点内存较大时,可调高该参数,以减少磁盘写入次数. io.sort.record.percent float 0.05 用作存储map输出(io.sort.mb)记录的比例.剩余的空间用来存储map输出记录本身 io.sort.spill.percent float 0.80 map输出开始写磁盘的阈值. io.sort.factor int 10 map输

Hadoop Interview Questions

Q1. Name the most common InputFormats defined in Hadoop? Which one is default? Following 2 are most common InputFormats defined in Hadoop - TextInputFormat - KeyValueInputFormat - SequenceFileInputFormat Q2. What is the difference between TextInputFo

hadoop三个配置文件的参数含义说明core-site.xml,hdfs-site.xml,mapred-site.xml

配置hadoop,主要是配置core-site.xml,hdfs-site.xml,mapred-site.xml三个配置文件,默认下来,这些配置文件都是空的,所以很难知道这些配置文件有哪些配置可以生效,上网找的配置可能因为各个hadoop版本不同,导致无法生效.浏览更多的配置,有两个方法: 1.选择相应版本的hadoop,下载解压后,搜索*.xml,找到core-default.xml,hdfs-default.xml,mapred-default.xml,这些就是默认配置,可以参考这些配置的

XI hadoop

XIhadoop 文本文件(索引): structured data ,RDBMS(表,字段,数据类型,约束): semi-structured data,半结构化数据(xml,json): google(网络爬虫.网络蜘蛛.网络机器人,20亿个页面,unstructureddata,pagerand页面排序算法): facebook,pv 500亿,化整为零(500G-->500*1G-->筛出50*100M数据),并行处理(将一个大问题切割成多个小问题,OLAP在线分析处理(数据挖掘):

连接Oracle与Hadoop(3) 使用OLH加载Hbase到Oracle

OLH是Oracle Loader for Hadoop的缩写,Oracle出品的大数据连接器的一个组件 本文介绍的就是如何使用OLH加载Hbase表到Oracle数据库. 前提:已部署Hadoop/Hive/Hbase与OLH软件 [[email protected] ~]$ tree -L 1 ├── hadoop-2.6.2 ├── hbase-1.1.2 ├── hive-1.1.1 ├── jdk1.8.0_65 ├── oraloader-3.4.0 创建Hbase表 create