to the spill phase, the cost depends on the amount of data to merge-sort and write back to disk. From the analysis Hadoop source code, this phase uses the merge-sort algorithm which has an average complexity of $nlogn$. Since the focus of this work is to identify key performance drivers, we ignore the less significant I/O cost at this stage. Hence, the relationship to model this phase is: $$T_{merge} = f(M_dlogM_d) = \beta_{0m} + \beta_5M_d(logM_d)
\label{eq:mergephase}$$

**Reduce Phase**
----------------

As shown in Figure \[mrworkflow\], Reduce Phase of each task consists of the following sub-phases: *Shuffle*, *Reduce* and *Write*. The cost analysis of each phase will be discussed as follows.

### **Shuffle**

When all map outputs have been copied, data are then merged into larger ones while maintaining their sorting order to be consumed by the next stage. To model this phase, we calculated the data that are shuffled through to each reducer. The total data processed by each reducer can be represented as: $$S_d = \frac{d * M_{sel} * M_t }{R_t} 
\label{eq:shuffledata}$$ Where $M_t$ is the total number of mappers, and $R_t$ is the total number of reducers. Using Equation , the cost model of the shuffle phase can be 