A Scheduling Algorithm based on PSO Heuristic in Cloud Computing

he goal of the SaaS provider is the most protable; the user's goal is to meet requirements as quickly as possible but still within budget and deadline. The algorithm's aim gives the schedule to satisfy the objectives of the agents, this is a very difficult problem. This article studies heuristic PSO (Particle Swarm Optimization) and model of components in the cloud computing to propose a model of PaaS providers; admission control algorithm and scheduling for the user’s requirements towards multi-objective optimization of time.The schedule given by the algorithm in order to: (1) optimizing the time for the user, (2) providing the greatest benefits for SaaS providers, (3) satisfying for the constraints of QoS (Quality of Service ) of the user. The result of the algorithm is installed and compared with other algorithms on CloudSim.


Introduction
Cloud computing is a distributed computing model for large scale, it provides services to users by employing resources (hardware, software, storage resources, ...) via the internet [18].It provides services to users by employing resources via internet. Users may employ the various resources through their requirements and pay as they use. When users send requests together with the constraints as todeadline, budget, workload, arrival time, ... to SaaS providers, SaaS providers use PaaS to admission control, then conduct scheduling requirements as Figure 1. PaaS provider searches for suitable resources on IaaS to logical mapping to user requirements.
The problem of scheduling on cloud computing differs from the multi-processor scheduling problem in some features: a) Can perform parallel tasks, tasks can always be completed on time.
b) Resources on cloud computing are provided by many vendors. So, at every moment, users can find the right resources.
c) Each request can reuse the expiration period of the other request d) Each user rents a virtual machine for a period of time. If the user does not use up the amount of time, other users can take advantage of it.
Generally, Scheduling problem on cloud computing with parameters such as workload, budget, deadline, ... is an NP-complete problem [1]. Therefore, one can not use the exhaustive method to find the optimal solution because the search time is too large. Nowadays, researchers often use heuristic methods to find near-optimal solutions such as: greedy method EDF ((Earliest Deadline First)) [4] [19], ACO (Ant Colony Optimization) method [2] [20], techniques optimized fuzzy bees [3], ... On cloud computing, users rent resources on datacenters and pay for cost over time. . Therefore, the scheduling problem based on constraint Quality of Service (QoS) is often used. In this case, the user's parameters such as arrival time, budget, deadline, etc., are given priority when scheduling. Jzau-Sheng Lin and colleagues [5] has proposed a scheduling model for cloud computing with the goal of bringing the highest profit for the SaaS provider but only interested in the deadlines and budget of the requirements. The study [6] focuses on the scheduling requirements for power savings on IaaS provider. Ramkumar N [7] has proposed a real-time scheduling algorithm but focused to solve scheduling tasks quickly satisfy most of the requirements deadline regardless of cost and its budget. Swarupa Irugurala, Dr.K.Shahu Chatrapati [8] has proposed a scheduling algorithm but is concerned only with the cost of virtual machine initialization and the cost of using the virtual machine. Gomathi B. and Medhat A. Tawfeek base on PSO (Particle Swarm Optimization), ACO to propose scheduling algorithms but only concerned with the execution time of the system.
Professor Rajkumar Buyya and colleagues [20], [21]have proposed scheduling algorithm works on cloud computing foward the system performance. The authors have combined with parallel processing, heuristics and PSO to handle the large volume of work. The proposed study and build the model of optimize non-linear workflows, minimize retrieve data for workloads which are requiring a large volume of data on cloud computing. These studies use a heuristic algorithm to provide PSO algorithm for faster convergence and computing time is less than the existing algorithm. However, these algorithms applies only to classes of problems with large volumes, the data transmission time is larger than the calculation time, not interested in the user's QoS constraints. The studie [22] are using the heuristic of the pack to provide optimal schedule of implementation time, not interested in the user's QoS constraints. To optimize the execution time, the studies [18], [23] are using the heuristic ACO, GA to provide a schedule with the aim of giving time to complete the smallest system but still satisfy the user's QoS constraints. The present study focuses on time constraints, not concerned about the cost of the system.
In this paper, the virtual machines on the data center are used to map the requirements aiming at making real-time implementation of the system minimal but still meeting deadlines and budgets requirements. SAPSO and MPSOalgorithmsare proposed.The goal of these algorithms is: (1) optimizing the time for the user, (2) providing the greatest benefits for SaaS providers, (3) satisfying for the constraints of QoS (Quality of Service ) of the user The paper includes: section 2, system model;section 3, two algorithms are proposed: SAPSO and MPSO then simulating, evaluating between the algorithms and conclusions [section 4].

System Model
Cloud computing consists of four main components [11]: User, Software as a Service (SaaS) providers, Platform as a Service (PaaS) providers and Infrastructure as a Service (IaaS) providers. Users send requests to use the attached software to their QoS requirements to the SaaS provider. PaaS providers analyze the QoS parameters, thereby deciding whether to accept or reject user requests. If the request is accepted, the scheduler will search for resources on the IaaS provider such as Figure 1.

SaaS providers model
SaaS providers lease resources from the IaaS provider and its leasing software as services for users. The goal of SaaS provider is how to minimize the cost of using resources from the IaaS providers to bring the highest profit to them.

IaaS provider model
Let is set suppliers, each IaaS provider provides virtual machines: for SaaS providers, is a5-tuble includes [11]: Initialization time t jx : how long it takes to deploy one virtual machine.
Price p jx : pricing depends on per hour that SaaS must pay for IaaS using VMs s jx : processor speed of virtual machines Dtp jx : the price SaaS provider must pay to transport data from resource provider client.
Dts jx : data transporting speed depends on network performance.

PaaS provider model
PaaS provider model is is a 3-tuble <R | npmtn | T min >. All IaaSprovider are not interdependent, can be executed in parallel and are denoted by R. We set schedule for N requests independently not to follow any particular order of priority (non-preemptive) on Y providers. These requirements are denoted bynpmtn. The aim is to find the minimum total completed time for requirements but still satisfying deadline and budget of the requirements, it means that T min must be found. The cost of data transmission ( ) includes the cost of sending data to and retrieve data from resource providers depend on the size of the input file and output file of the request , data transfer speeds( )and prices to transfer data from the virtual machine to user computers. is calculated as follows: Costs initialized of virtual machine depends on the initialization time and price of the request on virtual machine . is calculated as follows: Costs of the SaaS provider must be returned to the users if not meeting the deadline ( depending on the penalty rate ( ) and exceeded time deadline of request on on virtual machine ( ). is calculated as follows: The objective of the article is find the virtual machine in the IaaS provider to minimize the time of completion, such as: where The cost of request is less than budget that is: The execution time ( ) of request must less than the deadline itself: Thus, To achieve the objective of article (8), two constraints (10) and (11) must be satisfied .

SAPSO algorithm
Based on the experience of swarm, Kennedy and Eberhart has proposedheuristic PSO [12]. heuristic PSO simulates the social behavior of birds or fish searching for food. Heuristic PSO is a common algorithm framework for solving optimal problems. So to apply PSO to the scheduling problem we need to define the parameters: velocity, Pbest and Gbest [12], [13], [14]. Bergh F. V. D and Clerc, M based on current velocity and distance from Pbest to Gbest to change position and speed as follows [14], [15]: where Therein: : position of particle x in dimension j; : position of particle x in dimension j+1; : inertia weight ( value: 0.1 … 0.9); , : acceleration coefficient (value: 1..2); r 1 , r 2 : random number between 0 and 1; : velocity of particle x in dimension j; : velocity of particle x in dimension j+1; ; : local best position of particle x; Gbest : global best position of the entire swarm.
Let is set consisting of Y particles. Each particle willloop N times to searches food in dimension space and is determined: where in is the position at the loop i ( i=1 ... N ) in dimension j ( j= 1 ... x M ) of the particle x; is the velocity at the loop i in dimension jof the particle x.
In section 2, we have Y providersandN requests of users, each particle is equivalent with each providers, each particle loop times to find resources for the request , The value of is virtual machine j of provider x, which is mapped to request . This value is taken from 1 to , and the value of is taken from to randomly, wherein is the number of virtual machines in each provider x. To achieve the goal of the problem as in formula (8), We need to determine the fitness function for particle x to select virtual machine j for request . Fitness function is calculated as follows: where is calculated as in formula (1), (2), (3) (section 2).
After calculating the fitness function for particle x, We can determine the local optimal position of particle x is as follows: where as constraints (10) and (11) in session 2.4 Local best position of particle x (Pbest x ) and global best position (Gbest) are determined as:

Output:
where :each request is mapped to the

10.
Update the position and velocity of the particles as formula (12), (13): 11.END FOR

MPSO algorithm
Provider resources are rented hourly, the user has to pay the hourly fee. If user do not use all their one-hour of hiring time, user also have to pay for a whole hour. At each point, each vendor has a lot of users rent resources. So if the user does not use up the amount of time, other users can take advantage of it. We call is the set of requirements, this set includes requirements, which can take advantage time of request . The requirements in can share a virtual machine. The set is defined as follows: Call is effective time to calculate the request after completing the request of on .
The value of iljx t depends on the workload, arrival time, speed of virtual machines and deadline of request and request . is calculated as follows: where , the speed of is mapped to request .

Input:
S is output of SAPSO algorithms. Mapping in S contains the requests, these requests are accepted by the supplier

Output:
where : each request is mapped to the Description algorithm: 1. Sort all request in S accordingly to the provider, then all requests of the same provider will be in the same group;

Correctness of the algorithms
M.Clerc [15] added the rate of convergence K to update the velocity for particle and has proved the correctness of the PSO algorithm. This ensures the correctness of the algorithm SAPSO.
The input of the algorithm SAPSO is Y independent provider, so we can create the Y thread which performed concurrently, each thread is an particle which searched on the set virtual machine of the corresponding provider. This will reduce the complexity of the algorithm and optimize the time schedule.
Each particle (Thread) just focuses on mappings request into based on the fitness function as formula (16). So, when the lower is, the higher the fitness function is, the probability of request choose is more. Therefore, when the required mapping into the virtual machine has a low time to implement, it will make the total execution time of all systems are reduced.
The resource rental provider with time is D-minute, therefore if user do not use all their D-minute of hiring time, user also have to pay for a whole D-minute. MPSOalgorithm takes advantage of this request to process the next request. The goal of the MPSO algorithm is to reduce the cost of the system, bringing the most benefit to the SaaS provider

Simulation and evaluation of the algorithms
This article uses NetBean 7.1.1, JDK 6 and CloudSim 2.1 (Simulation tool on cloud computing) [16] to install algorithms. In CloudSim 2.1, we use 4 Datacenter, 10 physical hosts, 150 virtual machines. Other parameters (users and resource providers) on CloudSim 2.1 are defined as follows: User service side: Workload is a random number from 8*10 4 MI to 10 5 MI, after determining the workload, we can determine the corresponding budget for the requirements. The arrival time is a random number from 1 to 500, deadline is a random number between (d l ,d u ) minutes and the different values of d l and d u are limited from 10 to 1500, deadline is random but must be greater than the arrival time. Other parameters of user service are taken as implicit in CloudSim.
On the IaaS provider's side: In simulation, we use four IaaS providers; each IaaS provider has a number of different virtual machines, each virtual machines has speed, costs, and different bandwidth. In simulation installation, the Vm class of CloudSim is inherited to create a virtual machines with the parameters of speed and cost are calculated as follows: speed is a random number from from 10 3 to 5*10 3 MIPS corresponding with the costs which are real numbers is a random number from from 0.001 to 0.01, other parameters of the virtual machine as bandwidth, initialization time of virtual machine, data center, brokers, etc. ... are taken as implicit in CloudSim.
Results in simulation is the result of the 10 tests and the average results are obtained.

Analyze the total cost, time and profit as fixed requests.
Figures 2,3 and 4 show the total time, cost and total profit of four algorithms: EDF, SAPSO, MPSO and Sequential, using 150 VMs and 1000 requests. Simulation results show that the total execution time of algorithms SAPSO and MPSO are almost as same as Sequential algorithms (as Figure 2), but the cost of MPSO is always lower than EDF, SAPSO and Sequential algorithms. Because the SAPSO algorithm is responsible for admission control, accepting its satisfied deadline and budget requests, so after the SAPSO algorithm has done processing, the accepted requests are got with less time consuming, this requesting set is the input data of MPSO scheduling algorithm. MPSO scheduling algorithm continues taking advantage of the advanced time interval of requests onto IaaS resource provider, which lead to the total of cost reduction as Figure 3 and total of profit increase as Figure 4.  Sequential algorithm does not take advantage of the time between requests, but uses exhaustive method to search the resource, so there will be many cases that the request can't use all the rental time, this will make the cost of the sequential algorithm increase and takes a very long time to schedule. For EDF algorithms, thisalgorithms only focus the ratio used: (where Ci is the execution time,Tiis deadline, m is is the number of virtual machines) [17] to map the request to the resource, so EDF algorithm but not focus in the budget of request. The advantage of the EDF algorithm is that all requests are always completed before the deadline,Therefore, to consider for the total profit for supplier, the paper doesn't consider to EDF algorithm. Sequential algorithm uses the exhaustive method to search the resource, therefore the larger the requests are, the more time used for scheduling the complexity of algorithm will be exponential, so the sequential algorithm is not considered in this section.

Analyze total cost, total execution time and total profit of requests as a fixed number of virtual machines and changing number of requests.
When the number of requests increases, it will have many requests that can't use all the rental time, while MPSO algorithm would be able to use all of such rental time. This will lead to the total cost of MPSO algorithm is much smaller than EDF and SAPSO algorithms as shown in Figure 6.And the total Profit gives to suppliers MPSO algorithm higher than SAPSO algorithm as Figure 7.
As shown in Figure 5, when the number of requests gets larger, the total of processing time will increase, the total processing time of both SAPSO and MPSO are nearly equal, while EDF algorithm only considers to use the ratio of U to find resources, not considering in finding the best resources, so that the total execution time of the EDF is often greater than the total execution time of SAPSO and MPSO.

Conclusion
In this article, we focus on the issue of admission control and the schedule for the requirements of users toward of multi-objective optimization. Based on the model of users and providers of IaaS of R.Buyya. The articles made the models of PaaS provider.From there, they apply the heuristic PSO to make calculations fitness function, the local best position of each particle and the global best position of the entire swarm. To optimize time-to schedule, optimize the execution time for the request and bring benefits to the suppliers , the articles proposed SAPSO and MPSO algorithm. These algorithms used parallel processing techniques and heuristic PSO to identify the resources with high-speed; to leverage overlapping period between the request to save costs.
After analyzing and evaluating simulation results using the the same samples and using same simulations tool show that SAPSO and MPSO algorithms have impressive improvement of time and cost when compared with some other scheduling algorithms.