## 4 Workload and Data Center Modeling
### Analytical Modeling Approach
#### 4.1.1 Workload Modeling  
A full model of workload demand prediction is proposed in our previous work [42]. This work is a continuation of the modeling operation, which will be used for the validation and testing of the optimized machine learning elastic scaling. The proposed analytical model describes the demands of the workload generated by clients' applications in all cloud service layers (AaaS, PaaS and IaaS), where the overall demands will be reflected in data center infrastructure resources (the IaaS layer). The infrastructure as a service layer provides computing resources as physical and virtual resources units, such as PM, RAM, CPU, Network, Storage, VM and Container. The Google cloud data center and workload demands were investigated in our previous work [40]; we formulated the analytical model by mapping out its features using statistical analysis. In a time window \(T_{w}\), there are \((J_{s})\) submitted jobs and \((T_{s})\) submitted tasks that construct the \((W)\) cloud workload. Workload demands request cloud resources during a time that is counted by time window segments \(T_{w}\) that affects the demands \(J_{s}\) and \(T_{s}\) by increasing or decreasing cloud resources. There are tasks that will end \(T_{e}\), of which some will end and finish successfully, \((T_{cf})\) and others will terminate (\(T_{ne}\)) due to failure or eviction or being killed or getting lost. Submitted tasks are served by cloud resources that are provisioned in response to demands and released once these jobs \(J_{e}\) and tasks \(T_{e}\) end. For Alibaba, the equivalent of a task is an instance. Each submitted job \(j\) includes a batch of tasks \((T_{j})\), where one task requires a vector of infrastructure resource demands \((R)\). Provisioned and de-provisioned data center resources are counted in resource unit \(R_{ij}\) of task \(i\) in job \(j\). For tasks that have ended, \(RE_{i}\) is the released resource vector of integer index \(i\). Equation (2), depicts the requested resources \(R_{t}\) in \(T_{w}\) duration at time \(t\), with a number of submitted tasks \(T_{ft}\) in \(J_{st}\) submitted jobs. \[R_{t}=\sum_{j=1}^{I_{nt}}\sum_{i=1}^{T_{ft}}R_{ij}. \tag{2}\]  
The total released resources \(RE_{t}\) depends on ended tasks \(T_{et}\) during time window \(t\), as Equation (3) depicts. \[RE_{t}=\sum_{i=1}^{T_{et}}RE_{i}. \tag{3}\]  
\(T_{ne}\) are the ended tasks that are not completed but terminated due to being failed, evicted, killed or lost. These tasks will be resubmitted, \(RR_{t}\), in the next time window, as Equation (4) depicts. \[RR_{t}=\sum_{i=1}^{T_{net}}RE_{i}. \tag{4}\]  
A data center's resources demanded (\(RD_{t}\)) by workload at time \(t\) during time window \(T_{w}\) is given by Equation (5). \[RD_{t}=R_{t}+RR_{t-1}-RE_{t}. \tag{5}\]  
Equation (6) represents the total workload demand \(W_{t}\) at the current time \(CT\), starting from time \(t=1\) as a count of time window \(T_{w}\). For Alibaba, the calculations are similar. with three parameters; the number of instances in the task, the number of tasks in the job and the number of jobs multiplied by instances of resource demand. \[W_{t}=\sum_{t=1}^{CT}RD_{t}. \tag{6}\]  
Using the above equations, the resource demands are found, and the following parameters \(I_{s}\), \(T_{s}\), \(T_{j}\), \(R_{ij}\), \(T_{e}\), \(T_{ne}\) and \(RE_{i}\) are extracted as stochastic probability events. However, these values are time-variant as stochastic random variables. The workload demands \(W\) is found using the aforementioned equations using \(J_{s}\) arriving jobs, \(T_{j}\) number of tasks per job, \(T_{s}\) total submitted tasks, \(R_{ij}\) requested resources per task, \(T_{cf}\) ended finished tasks, and \(T_{ne}\) the ended nonfinished tasks. A normal random variable (Gaussian distribution) is used to model the number of submitted jobs \(j\), the total submitted jobs \(J_{st}\) and the number of submitted tasks \(i\) of total submitted tasks \(T_{st}\) probabilities during time interval \(T_{w}\) as depicted in Equation (7).