# Profit-Efficient Elastic Allocation of Cloud Resources Using Two-Stage Adaptive Workload Prediction
## 6 Performance Evaluation
### MaxCSPR with Workload Prediction Evaluation  
To analyze how different workload prediction methods impact the performance of the MaxCSPR algorithm, we compared the number of VMs required by MaxCSPR under different prediction methods to that under the real workload. The results are compared in Table 3.  
According to Table 3, due to the high prediction accuracy of the ATSMNN-LSTM algorithm, its prediction error for the VM number compared to the real workload was improved, in terms of the MAPE and RMSE values (0.0276 and 0.7719, respectively). Moreover, the \(R^{2}\) was better for ATSMNN-LSTM (0.9356) than for the other prediction methods. Thus, the prediction method is a key element that impacts the resource allocation accuracy of the proactive method in the cloud computing context. The results demonstrate that MaxCSPR-NWP can obtain higher accuracy regarding allocation of the number of VMs. Meanwhile, Figure 27 shows that the VM number can be allocated in an elastic and online manner, according to the change in the workload. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Metric** & **MAPE** & **RMSE** & \(\mathbf{R}^{2}\) \\ \hline ATSMNN-LSTM & 0.0276 & 0.7791 & 0.9356 \\ ATSMNN & 0.0348 & 0.8809 & 0.9177 \\ ARIMA & 0.0381 & 0.9661 & 0.9010 \\ LR & 0.0533 & 1.5509 & 0.7448 \\ SVR & 0.0793 & 1.4661 & 0.7719 \\ LSTM & 0.0329 & 0.8213 & 0.9284 \\ Transformer & 0.0332 & 0.8412 & 0.9223 \\ LSTM-Transformer & 0.0361 & 0.9102 & 0.9121 \\ NN & 0.0355 & 0.8971 & 0.9146 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Metrics of virtual machine allocation using different workload prediction methods. To evaluate the performance of the MaxCSPR algorithm in a real system, we used CloudSim [47] to conduct a simulation experiment. This simulation system can be considered as a real-time queueing serve system (i.e., a real-time model) with first-come-first-served policy in the cloud center. Based on the definition of the ergodic process in Poisson processes, the workload in a small time slot \(\Delta_{\tau}\) can be generated using Equations (20) and (21), and the average task processing time was 5 ms (i.e., the MIPS of each VM was 1000 and the average instruction length was 5 million instructions), and the task length was generated using the exponential distribution with the mean value (5 million instructions). The average task delay (AT.Delay) and VM system load (VS.Load) in the CloudSim simulation are shown in Figure 28.  
According to Figure 28, the VM system load of the MaxCSPR-NWP algorithm was below 90%, indicating the stability of the VM system. Moreover, the VM system load was higher than 70%, which means that the computing resource (CPU) and cloud rental costs were used effectively. In this figure, the trend of the VM system load and average task delay are the same (i.e., when the VM system load was small, the workload of the task arrival was small and the average task delay was small, and vice versa). Notably, the average task  
Figure 27: Virtual machine (VM) number allocation using the MaxCSPR algorithm. Figure 28: Average task delay (AT.Delay) and virtual machine (VM) system load (VS.Load) in CloudSim simulation. delay and VM system load were concentrated in a stable interval as VMs can be allocated online and on demand, according to the change in workload. Moreover, the cloud service can guarantee the QoS requirements; namely, the average task delay was lower than 100 ms. Overall, the results demonstrate that the proposed proactive cloud resource allocation method--that is, the MaxCSPR-NWP algorithm--guarantees both the QoS requirements and VM system stability, while also optimizing the effective usage of cloud resources and improves the profit of the cloud service.