0 votes
1 view
in Big Data Hadoop & Spark by (11.5k points)

In Google's MapReduce paper, they have a backup task, I think it's the same thing with speculative task in Hadoop. How is the speculative task implemented? When I start a speculative task, does the task start from the very beginning as the older and slowly one, or just start from where the older task has reached(if so, does it have to copy all the intermediate status and data?)

1 Answer

0 votes
by (11.5k points)

Apache Hadoop does not fix or diagnose slow-running tasks. Instead, it tries to detect when a task is running slower than expected and launches another, an equivalent task as a backup. The backup task is called as speculative task and the process is called speculative execution in Hadoop. It is a key feature of Hadoop that improves job efficiency.

In Hadoop, MapReduce breaks jobs into tasks and these tasks run parallel rather than sequential, thus reduces overall execution time. This model of execution is sensitive to slow tasks (even if they are few in numbers) as they slow down the overall execution of a job.

There may be various reasons for the slowdown of tasks, including hardware degradation or software misconfiguration, but it may be difficult to detect causes since the tasks still complete successfully, although more time is taken than the expected time. Hadoop doesn’t try to diagnose and fix slow running tasks; instead, it tries to detect them and runs backup tasks for them. This is called speculative execution in Hadoop. These backup tasks are called Speculative tasks in Hadoop.

Working of Speculative engine in Hadoop - 

Firstly all the tasks for the job are launched in Hadoop MapReduce. The speculative tasks are launched for those tasks that have been running for some time (at least one minute) and have not made much progress, on average, as compared with other tasks from the job. The speculative task is killed if the original task completes before the speculative task, on the other hand, the original task is killed if the speculative task finishes before it.

Enabling & Disabling of Speculative execution - 

Speculative execution is enabled by default. You can disable speculative execution for mappers and reducers in mapred-site.xml as shown below:

<property>

<name>mapred.map.tasks.speculative.execution</name>

<value>false</value>

</property>

<property>

<name>mapred.reduce.tasks.speculative.execution</name>

<value>false</value>

</property>


 

...