\label{eq:mapt}$$ Now substituting the phases with their corresponding linear cost models and replacing all the constants $\beta_{0*}$ as $\beta_{0}$ together to have $$T_{mt} = \beta_0 + \beta_1d + \beta_2d + \beta_3M_d + \beta_4M_d + \beta_5M_dlogM_d + T_{map} + \epsilon
\label{eq:maptotal}$$ Similar to the Map Phase, we can combine all the initial formula in the sub phases of the reduce phase, i.e., $$T_{rt} = T_{shuffle} + T_{reduce} + T_{write}
\label{eq:redt}$$ Putting the cost models together, we have: $$T_{rt} = \beta_0 + \beta_6S_d + \beta_7S_d + \beta_8R_d + T_{reduce} + \epsilon
\label{eq:reducetotal}$$

**Cost Model For The Entire Process**
-------------------------------------

The models presented in the previous section represent models for a single task. MapReduce runs several tasks in parallel. Depending on the system resources, all task may run in one round, or in most cases, there will be several rounds of tasks before the entire job finishes. Before YARN, map and reduce slots were used to determine the number of tasks that can run concurrently. This approach does not fully utilise the cluster resource and previous performance models using this approach cannot be applied to YARN-based MapReduce application. YARN uses *containers* for task execution. The number of containers in a cluster determines the 