Research on Virtual Machine Response Time Prediction Method Based on GA-BP Neural Network

Cloud application provides access to large pool of virtual machines for building high-quality applications to satisfy customers’ requirements. A difficult issue is how to predict virtual machine response time because it determines whenwe could adjust dynamic scalable virtual machines. To address the critical issue, this paper proposes a prediction virtual machine response time method which is based on genetic algorithm-back propagation (GA-BP) neural network. First of all, we predict component response time by the past virtual machine component usage experience data: the number of concurrent requests and response time. Then, we could predict virtual machines service response time. The results of large-scale experiments show the effectiveness and feasibility of our method.


Introduction
A critical issue that must be solved for the cloud application providers is to allocate and manage virtual resources because virtual machines are dynamic scalability in the cloud environment [1].Cloud application customers expect to receive a certain level service performance as specified in SLA (service level agreement) [2].Response time is an important indicator in the SLA.Providers dynamically adjust resources by checking whether the service response time exceeds the threshold ruled by SLA.However, it may lead to hysteresis and cause frequent adjustment of resources.Dynamic resource allocation scheme adjusts resources when multiple predicted response time values exceed the threshold of SLA.Therefore, predicting service component response time has high reference value for determining the right time to adjust resources.Traditional service component response time prediction methods do not consider the dynamic scalability of cloud environment [3]; therefore, they are not applicable to service component response time prediction in the cloud environment.It becomes an urgent task to explore an effective virtual machine service component response time prediction method.
In this paper, we adopt GA-BP neural network model to predict the virtual machine component response time.It needs not consider the relationship between component concurrent request and response time or mathematical model.The model only requires training to establish the mapping relationship on the network, similar to "black box" method.The BP neural network has several advantages: nonlinear mapping ability, reducing the error between the predicted values and real value, and increasing speed of system processing [4].GA-BP neural network model overcomes BP algorithm's problem, such as slow convergence and local optimal solution, and solves genetic algorithm's problem of approximate optimal in a short period.Thus the model has not only the self-learning ability of neural network but also the global searching ability of genetic algorithm.
In this paper, we propose a virtual machine service component response time prediction model based on GA-BP neural network.We collect three kinds of data: the number of components concurrent requests, initialized configuration parameters of virtual machine, and component response time.Then, we predict the total number of components concurrent requests according to the weight of every virtual machine.Finally, we predict service component response time on the virtual machine.
The experiments indicate that GA-BP network model is more effective than traditional BP network model, and that service component response time prediction algorithm based 2

Cloud application
Virtual resource pool on GA-BP network is more accurate than typical algorithms.The algorithm could be used as a reference for time selection in resource adjustment decision.The rest of the paper is organized as follows.Section 2 gives a brief overview of existing research related to service response time model and BP neural network.Section 3 presents component response time prediction algorithm in detail.Section 4 shows the experimental results and Section 5 concludes the paper.

Related Work
At present, the research on service response time prediction is mainly in the field of Web service.In [5], it uses time series achieved good service response time prediction results in the field of Web services and grid computing.However, it does not apply to cloud application because cloud application is dynamic scalability and the number of virtual machines and resources is constantly changing [3].It will break the development law of service response time.What is more, the method needs to build model of response time and it will degrade performance.
In [6], it uses queuing theory to predict response time.Queuing theory is a mathematics theory to study stochastic service system [7].In [8], it builds the target system model, simplified system, and abstract system.It assumes that the arrival time obeys Poisson process and service time obeys exponential distribution.In fact, the real environment does not completely obey assumption.
BP neural network is a common method of training artificial neural networks to predict service response time [4].In [9], it uses BP neural network to predict time delay.The network learns from many inputs for a desired output.It is effective with nonliner approximation, but the convergence of the algorithm is very slow and may have local minimum problem.Genetic algorithm is a search heuristic that mimics the process of natural selection [10].It overcomes BP algorithm's problem of slow speed of convergence and local minimum.
Previous studies always used genetic algorithm and BP neural network to predict traffic and futures, but it was not used to predict virtual machine service response time in cloud.Therefore, the paper proposed response time prediction method based on GA-BP neural network.It could overcome the shortages of previous work which could not adapt to resource dynamic scalability and accuracy.Moreover, it could satisfy the service performance as specified in SLA.

Virtual Machine Response Time Prediction Model
3.1.Cloud Application Architecture.Figure 1 shows the cloud application architecture.Service can be implemented by combing several virtual machines in the cloud application.The same set of components is deployed on several virtual machines, and balanced workload virtual resource pool is combined with several virtual machines.QOS will be affected by performances of other components on the virtual machine and performances of other virtual machines on the cloud application.

Response Time Prediction Model.
In this section, we propose a virtual machine service component response time prediction model which is based on GA-BP neural network to solve random volatility of concurrent requests and virtual machine dynamic scalability.Figure 2 shows the response time prediction produce.First of all, we predict every component response time on the virtual machine.Then we predict virtual machine service component total response time.
Virtual machine component response time prediction process is divided into two situations.
(1) The collected data could predict response time of the old virtual machine (it has been used before).
(2) The collected data could not predict response time of the new virtual machine (it has been not used before).
There are three steps to predict the new virtual machine component response time.Step 1. Collect the number of components concurrent requests and components response time.
Step 2. Use the history data to find the old virtual machine which is the most similar to the new virtual machine.
Step 3. The number of component concurrent requests is put into prediction model.Calculate the new virtual machine component response time.
The prediction method of the old virtual machine is similar to the new virtual machine.Because the old virtual machine has a lot of history data to predict component response time; we omit the third step.After predicting component response time in the next period, we calculate service response time by weighting every virtual machine component response time.

Component Response Time Prediction Model
In this section, we propose a virtual machine component response time prediction model based on GA-BP neural network.In Section 4.1, we use similarity calculation model to find out the most similar virtual machine and use the most similar virtual machine to find out the relationship between component current requests and component response time.In Section 4.2, we determine the structure of BP neural network, critical parameters, and genetic operator.
In Section 4.3, we set up genetic algorithm parameters to predict accurate component response time.In Section 4.4, service component response time is calculated.

Virtual Machine Configuration Similarity Computation
Model.There are  old virtual machines.If we add a new virtual machine, the configuration data will be put into the database.We choose  performance parameters to calculate similarity.The set of  old virtual machines is denoted as  = { 1 ,  2 , . . .,   }.Performance parameters of virtual machine  1 are denoted as   = { 1 ,  2 , . . .,   },  = 1, 2, . . ., .The original virtual machine characteristic matrix is denoted as follows: Performance parameters include CPU speed, memory capacity, I/O rate, and network bandwidth.We normalize virtual machine performance parameter configuration matrix and use weighted Euclidean distance to calculate two virtual machines similarity.Computation formula is denoted as follows: We calculate similarity to find the most similar virtual machine.We need a lot of data to train the relationship between the number of virtual machine component current requests and component response time.
Layer.Hecht-Nielson proved that a hidden layer BP neural network could approximate any continuous function of a closed interval [11].We use a BP neural network with one hidden layer.
Hidden Nodes.The number of hidden layer neurons affects the accuracy and speed of solving problem [12].We use cutand-trial method to determine the number of hidden layer neurons, and the empirical formula is in which  and  are the number of components, and  is a constant.
Activation Function.The hidden layer uses tansig sigmoid function, and the output layer uses purelin sigmoid function.
Tansig is denoted as follows: ( Its first-order backward function is denoted as follows: Purelin function is denoted as follows: Initial Weight and Threshold.Initial weight and threshold affect convergence ability and training time.In this paper, initial weight and threshold are random numbers between −1 and 1.
Learning Rate.Learning rate decides the weight variation in the circuit training.We choose 0.01 as learning rate to ensure network stability.
Learning Algorithms.The standard BP algorithm has slow convergence speed problem and local minimum problem.
In this paper, we use fast learning algorithm based on L-M (Levenberg-Marquardt) [13].
Error index function: () is the  time iterative network weight vector, and the weight adjustment formula is Weighted differential Jacobian Matrix is .Network error vector is .Unit matrix is .Coefficient is , which is adaptive adjustment.
If error index function () is reduced, we will use  to calculate (+1).Then we decrease ; otherwise we increase .
The set of the number of  components current requests and  components response time is {(  ,   ) |  ∈   ,  ∈   ,  = 1, 2, . . ., }.The total samples are divided into training sample  1 and testing sample  2 : First of all, we train  1 groups component current requests and response time sample to establish mapping relation.Then, we use the number of component current requests from the  1 + 1th group to the th group to predict component response time.
The training sample network error is denoted as follows: The network total error is less than  1 : Testing sample of mean square error is less than  2 : Because we are not sure of the accurate number of concurrent requests and the sample response time.Even if  1 is small, we still cannot ensure that  2 is up to grade.

Genetic Algorithm Parameters Setup. Genetic algorithm optimizes BP network component response time prediction
weight to overcome some shortages of BP neural network, so we can accurately predict component response time.Genetic algorithm for optimizing network weight needs to design the main parameters.
Encoding System.There are two chromosome encoding methods: binary encoding and real encoding.Real encoding is shorter than binary encoding, and it needs not switch back and forth between encoding and decoding [14,15].We use real encoding to improve computation efficiency.

(14)
Number of Initial Population.If the number of initial population  is small, it will not benefit weight threshold crossing and variation and will decrease the diversity of population.But on the contrary, the running efficiency of genetic algorithm will decrease.Therefore, we decide  is 30.
Fitness Function.Fitness function is an index to decide the chromosome quality and is the only measure to guide the genetic algorithm search.Training overall error is as small as possible, and genetic algorithm uses the maximum objective function value as the fitness function.We calculate square of components response time error sum in the training sample according to formula (12), and chromosome adaptive value is = 1, 2, . . .,  is chromosome number.
Selection Operator and Selection Probability.We select the most fitness individual to continue genetic manipulation.In this paper, we adopt roulette wheel selection method.Fitness   selective probability is   : Crossover Operator and Crossover Probability.We randomly select two chromosomes and choose their weights and thresholds with crossover probability to form two new individuals    ,    .We use arithmetic crossover operation to generate two new individuals: ∈ (0, 1) is a parameter.We adopt nonuniform arithmetic crossover operator .If the crossover probability value is large, the convergence speed will be fast.On the contrary, if the crossover probability value is small, algorithm performance will be reduced.In this paper,   is 0.4.(1) Determine the number of concurrent requests, set the related parameters, establish the BP neural network.

Mutation Operator and Mutation
(2) Set up population size , chromosome length , number of iterations , crossover probability   and mutation probability   .Initialize  sets of weighting value of the threshold.Form population.(3) Train the BP neural network.Calculate individual adaptiveness according to formula (15).Choose the optimal chromosome.(4) Use roulette wheel selection method to choose  the most adaptive individuals.with the last generation optimal individual.If the former is more adaptive, it will replace the last generation optimal individual.Moreover, the last generation optimal chromosome replace the worst chromosome. =  + 1, if  = , algorithm will be stoped.Then we get optimal weight threshold.Otherwise, go to Step 4. ( 8) Decompose the optimal individual to get BP neural network connective weight threshold.If the mutation probability is too large, algorithm performance will be reduced.Instead, the species diversity will be poor.In this paper,   is 0.4.
Termination Condition.We adopt maximum evolution algebra as termination condition.In this paper, it is 100.

Service Response Time Calculation.
According to the previous sections, Algorithm 1 shows the steps of component response time prediction procedure.
There are  components deployed on  virtual machines and  requests which are transmitted to component  on virtual machine .Virtual machine response time   is denoted as Calculate weighted sum of  virtual machines component response time.Therefore service response time is

Experimental Evaluation
5.1.Experimental Setup.We deploy six virtual machines on the server and two virtual CPUs on the virtual machine.Then, we deploy three procedures on the six virtual machine clients.
Load balancer is deployed requests on virtual machine according to ratio and the client sends requests to the load balancer.Finally, we monitor the number of virtual machine current requests and the response time every 30 seconds and put the monitor data into database.After the server runs for several minutes, we add a new virtual machine.

GA-BP Neural Network
Structure.When we calculate similarity, the weight vector was {0.5, 0.25, 0.15, 0.1}, which represented CPU, memory, I/O, and bandwidth.We found out that the most similarity virtual machine was VM3, and we used the number of VM3 component concurrent requests and response time to predict VM7 (the new VM) service component response time.We predicted VM7 component concurrent time by traditional BP algorithm and GA-BP algorithm and evaluated the new algorithm.There were 300 samples on VM3.80% of the samples were training Normalization data is x, and current data is .

Result Analysis of Comparative
Experiment.We use GA-BP neural network model to predict 21 components on 7 virtual machines.The next service response time prediction value is 0.985 s, and the real response time is 0.997 s.Under the same experiment condition, we also use BP neural network, time series, and queuing theory to predict service response time in 60 seconds.Figure 5 shows every method prediction error.When prediction time is less than real time, the error is a negative and vice versa.Figure 6 compares GA-BP neural network prediction response time with real response time.Figure 7 shows the differences between BP neural network prediction response time and real response    time.Figures 8 and 9 show traditional time series and queuing theory prediction response time in contrast to real response time.Time series and queuing theory are not as accurate as GA-BP neural network and BP neural network, because BP neural network could reduce the error between the predicted values and real value and increasing speed of system processing.What is more, GA-BP neural network overcomes local optimal solution and approximate optimal in a short period.Therefore, it is more stable than other methods in the whole prediction process.

Conclusion and Future Work
Cloud environment dynamic scalability will break the law of service response time.Traditional method cannot satisfy prediction accuracy requirements.In this paper, we propose a novel method to predict virtual machine response time based on GA-BP neural network.We predict components response time on the VM and calculate virtual machine service response time.The extensive experimental results show the effectiveness and efficiency of our framework.
For future work, we will investigate more techniques for improving the prediction accuracy.

( 5 )
Choose several pairs of chromosomes in Step 4 and random number ,  ∈ [0, 1] for every pair.If  <   , chromosome execute crossover operation.(6) Choose several pairs of chromosomes in Step 5 and random number ,  ∈ [0, 1] for every pair.If  <   , chromosome execute mutation operation.(7) Choose the individual in Step 6 as network weight threshold to train BP network.Compare the optimal individual

( 9 )Algorithm 1 :
BP network initial iteration value  = 1.(10) Put the amount of component concurrent requests and response time sequences into model, and calculate component response time according to formula (3).(11) Formula (12) calculates the first sample component response time prediction error quadratic sum and formula (9) adjusts weight.(12) Choose the second sample component current requests amount and response time.Repeat Steps 10 and 11 until finishing  samples training.(13)  =  + 1. if  =  or the overall error of the network  < .When training process is ended, we get future component response time.Otherwise, go to Step 10. (14) Put the number of  components current requests into trained network.Then get the new virtual machine component  response time.Component response time prediction procedure.

Figure 3 :
Figure 3: Performance curve of BP neural network training process.

Figure 6 :
Figure 6: Comparison between GA-BP neural network prediction value and real value.

Figure 7 :
Figure 7: Comparison between BP neural network prediction value and real value.

Figure 8 :
Figure 8: Comparison between time series prediction value and real value.

Figure 9 :
Figure 9: Comparison between queuing theory prediction value and real value.

Table 1 :
Net error of different hidden layer node number.