# Stream Data Load Prediction for Resource Scaling Using Online Support Vector Regression
## 5 Stream Data Load Prediction for Cloud Recourse Scaling  
For the data load that changes with time, fixed cloud resource distribution will result in a waste of resources or a low quality of service. Based on stream data load time series prediction, this paper proposes a flexible distribution algorithm to extend or shrink the virtual machine in order to satisfy SLA. The maximum sustainable throughput (MST) is the maximum throughput of the stream processing system that can read the data indefinitely. It is an important indicator that the cloud service provider needs to consider in terms of stream processing system. The MST performance model is a function of system MST and virtual machine. It is defined as follows:  
\[MST(m)=\frac{1}{t(m)}=\frac{1}{w_{0}+w_{1}*\frac{1}{m}+w_{2}*m+w_{3}*m^{2}} \tag{16}\]  
Here, \(m\) represents the number of virtual machines, and \(w_{0}\) represents serial processing time, \(w_{1}\) represents parallel processing time, \(w_{2}\) represents data input / output time, \(w_{3}\) indicates the communication time between virtual machines, and all weights are non-negative (\(w_{i}\geq 0,i=0,1,2,3\)). While the stream processing system resources are fixed, the number of work nodes and the number of executor assigned in the work node are fixed, and the number of task that can be processed is fixed, when the stream data input load is larger than throughput of the system, it will lead to the accumulation of large amounts of data in Kafka, and the stream processing system cannot process data normally. The spark processing data are handled at the interval of the time window. When the time window is not considered while configuring the number virtual machines appropriately by using the MST performance model, only the overall throughput of the system is greater than the input load. This may result in a system throughput of less than input load at the interval of the time window, the next time window system throughput is far greater than the input load. From the overall point of view, the system processing data is greater than the input load, which will lead to the system in a certain time window not being able to handle the normal data. However, if the data is lost to the next time window to process, it may cause a data processing delay, disorderly sequences, packet loss and other consequences. In order to ensure the performance of the system, in each time window interval, the system throughput is greater than its input load, so the overall throughput of the system will be larger than the overall input load, and the stream processing system can handle the data normally. Therefore, it is useful and necessary to get the maximum throughput of data in the time window interval. The paper strengthens the MST to the maximum sustainable throughput of time window (MSTW), MSTW is the limit of the flow processing system's sustainable processing of data within the time window, and the MSTW performance model is calculated as follows:  
\[MSTW(m,T)=MST(m)*T \tag{17}\]  
Here, \(T\) refers to the interval of the time window. The MSTW performance model obtains the maximum throughput of the virtual machine within the time window interval, which can handle the maximum throughput of \(MSTW_{ SLA}(m,T)\). To expand the cluster to deal with the fluctuating stream data load, we can predict the data input load in advance by understanding the relationship between VMs and the MSTW. The cluster can distribute the VMs flexibly to stabilize the processing performance of the system before the stream processing system reaches MSTW. This paper presents an elastic allocation algorithm TWRES (Time window resource elasticity scaling algorithm) (Algorithm 1) for load forecasting and time window throughput.