Cloud Task Scheduling Based On Ant Colony Optimization
Cloud Task Scheduling Based On Ant Colony Optimization
Abstract: Cloud computing is the development of distributed computing, parallel computing and grid computing, or defined
as the commercial implementation of these computer science concepts. One of the fundamental issues in this environment is
related to task scheduling. Cloud task scheduling is an NP-hard optimization problem and many meta-heuristic algorithms
have been proposed to solve it. A good task scheduler should adapt its scheduling strategy to the changing environment and
the types of tasks. In this paper, a cloud task scheduling policy based on Ant Colony Optimization (ACO) algorithm compared
with different scheduling algorithms First Come First Served (FCFS) and Round-Robin (RR), has been presented. The main
goal of these algorithms is minimizing the makespan of a given tasks set. ACO is random optimization search approach that
will be used for allocating the incoming jobs to the virtual machines. Algorithms have been simulated using cloudsim toolkit
package. Experimental results showed that cloud task scheduling based on ACO outperformed FCFS and RR algorithms.
Received July 3, 2013; accepted September 2, 2013; published online April 23, 2014
processing cores, system bus etc., [21]. Hence, the exploiting the search space, learning strategies are
amount of hardware resources available to each VM is used to structure information in order to find
constrained by the total processing powers such CPU, efficiently near-optimal solutions [18].
the memory and system bandwidth available within the
host [21]. 2.3. Related Work
2.2. Combinatorial Optimization Problem Millions of user share cloud resources by submitting
their computing task to the cloud system. Scheduling
In combinatorial optimization problems, we are looking these millions of task is a challenge to cloud
for an object from a finite or possibly countably infinite computing environment. Optimal resource allocation
set. This object is typically an integer number, a subset, or task scheduling in the cloud should decide optimal
a permutation or a graph structure [15]. A combinatorial number of systems required in the cloud so that the
optimization problem P=(S, f) can be defined by: total cost is minimized. Cloud service scheduling is
• A set of variables X ={x1, x2, …, xn}. categorized at user level and system level [6]. At user
• Variable domains D1, …, Dn. level scheduling deals with problems raised by service
• Constraints among variables. provision between providers and customers [17, 21].
The system level scheduling handles resource
• An objective function f to be minimized where,
f: D1*…* Dn →R+. management within data centers [8, 11, 16]. A novel
approach of heuristic-based request scheduling at each
The set of all possible feasible assignments is: S={s= server, in each of the geographically distributed data
{(x1,v1), …, (xn,vn)}|vi ∈ Di, s satisfies all the constraints} centers, to globally minimize the penalty charged to
S is usually called a search (or solution) space, as each the cloud computing system is proposed in [1]. A
element of the set can be seen as a candidate solution. new fault tolerant scheduling algorithm MaxRe is
To solve a combinatorial optimization problem one has proposed in [23]. This algorithm incorporates the
to find a solution s* ∈ S with minimum objective reliability analysis into the active replication schema
function value [15]. Examples for, combinatorial and exploits a dynamic number of replicas for
optimization problems are the Travelling Salesman different tasks. Scheduling based genetic algorithm is
Problem (TSP), the Quadratic Assignment Problem proposed in [12, 14, 22]. This algorithms optimizes the
(QAP), time tabling and scheduling problems. Due to energy consumption, carbon dioxide emissions and
the practical importance of combinatorial optimization the generated profit of a geographically distributed
problems, many algorithms to tackle them have been cloud computing infrastructure. The QoS Min-Min
developed. These algorithms can be classified as either scheduling algorithm is proposed in [10]. An
complete or approximate algorithms. Complete optimized algorithm for VM placement in cloud
algorithms are guaranteed to find for every finite size computing scheduling based on multi-objective ant
instance of a combinatorial optimization problem an colony system algorithm in cloud computing is
optimal solution in bounded time. In approximate proposed in [8]. Scheduling in grid environment based
methods we sacrifice the guarantee of finding optimal ACO algorithms are proposed in [13, 14, 19]. The
solutions for the sake of getting good solutions in a existing scheduling techniques in clouds, consider
significantly reduced amount of time especially for parameter or various parameters like performance,
combinatorial optimization problems that are NP-hard makespan, cost, scalability, throughput, resource
[18]. Among the basic approximate methods we usually utilization, fault tolerance, migration time or
distinguish between constructive methods and local associated overhead. In this paper, cloud task
search methods. Constructive algorithms generate scheduling based ACO approach has been presented
solutions from scratch by adding components to an for allocation of incoming jobs to VMs considering in
initially empty partial solution until a solution is our account only makespan to help in utilizing the
complete. Local search algorithms start from some available resources optimally, minimize the resource
initial solution and iteratively try to replace the current consumption and achieve a high user satisfaction.
solution by a better solution in an appropriately defined
neighbourhood of the current solution [15]. In past, four
decades, a new kind of approximate algorithm has
3. Cloudsim
emerged which basically tries to combine basic Simulation is a technique where a program models the
heuristic methods in higher level frameworks aimed at behaviour of the system (CPU, network etc.,) by
efficiently and effectively exploring a search space. calculating the interaction between its different entities
This class of algorithms includes ACO, simulated using mathematical formulas, or actually capturing and
annealing, tabu search and others [18]. A metaheuristic playing back observations from a production system
is formally defined as an iterative generation process [3]. Cloudsim is a framework developed by the
which guides a subordinate heuristic by combining GRIDS laboratory of university of Melbourne which
intelligently different concepts for exploring and enables seamless modelling, simulation and
Cloud Task Scheduling Based on Ant Colony Optimization 131
experimenting on designing cloud computing • Data Center Broker: It models a broker, which is
infrastructures [3]. responsible for mediating negotiations between
SaaS and cloud providers.
3.1. Cloudsim Characteristics • VM Allocation: A provisioning policy which is run
Cloudsim can be used to model datacenters, host, in data center level helps to allocate VMs to hosts.
service brokers, scheduling and allocation policies of a • VM Scheduler: This is an abstract class
large scaled cloud platform. Hence, the researcher has implemented by a host component that models the
used cloudsim to model datacenters, hosts, VMs for policies (space-shared, time-shared) required for
experimenting in simulated cloud environment [9]. allocating processor cores to VMs. It is run on
Cloud supports VM provisioning at two levels: every host in data center.
• Host: It models a physical server.
1. At the host level: It is possible to specify how much • VM: It models a VM which is run on cloud host to
of the overall processing power of each core will be deal with the cloudlet.
assigned to each VM known as VM policy • Cloudlet: It models the cloud-based application
Allocation. services.
2. At the VM level: The VM assigns a fixed amount of • Cloudlet Scheduler: This abstract class is extended
the available processing power to the individual by the implementation of different policies that
application services (task units) that are hosted determine the share (space-shared, time-shared) of
within its execution engine known as VM processing power among cloudlets in a VM [9].
Scheduling [9].
In this paper, the ACO algorithm will be used for CIS
3.2. Cloudsim Data Flow Figure 1. Main parts of cloudsim related to our experiments.
clear that an ACO algorithm can be applied to any The pseudo code of the proposed ACO algorithm and
combinatorial problem as far as it is possible to define: scheduling based ACO algorithm are shown in
Algorithms 1 and 2 respectively.
1. Problem representation which allows ants to The main operations of the ACO procedure are
incrementally build/ modify solutions. initializing pheromone, choosing VM for next task
2. The heuristic desirability η of edges. and pheromone updating as following:
3. A constraint satisfaction method which forces the
Algorithm 1: ACO algorithm
construction of feasible solutions.
4. A pheromone updating rule which specifies how to Input: List of Cloudlet (Tasks) and List of VMs
modify pheromone trail τ on the edges of the graph. Output: The best solution for tasks allocation on VMs Steps:
5. A probabilistic transition rule of the heuristic 1. Initialize:
desirability and of pheromone trail [2]. Set Current_iteration_t=1.
Set Current_optimal_solution=null.
In this section, cloud task scheduling based ACO Set Initial value τij(t)=c for each path between tasks and VMs.
algorithm will be proposed. Decreasing the makespan 2. Place m ants on the starting VMs randomly.
3. For k:=1 to m do
of tasks is the basic ideas from the proposed method. Place the starting VM of the k-th ant in tabuk.
1. Problem Representation: The problem is represented Do ants_trip while all ants don't end their trips
Every ant chooses the VM for the next task according to
as a graph G=(N, E) where the set of nodes N Equation 1.
represents the VMs and tasks and the set of edges E Insert the selected VM to tabuk.
the connections between the task and VM as shown End Do
in Figure 2. All ants are placed at the starting VMs 4. For k:=1 to m do
Compute the length Lk of the tour described by the k-th ant
randomly. During an iteration ants build solutions to
according to Equation 4.
the cloud scheduling problem by moving from one Update the current_optimal_solution with the best founded
VM to another for next task until they complete a solution.
tour (all tasks have been allocated). Iterations are 5. For every edge (i, j), apply the local pheromone according to
indexed by t, 1< t< tmax, where tmax is the Equation 5.
6. Apply global pheromone update according to Equation 7.
maximum number of iterations allowed. 7. Increment Current_iteration_t by one.
8. If (Current_iteration_t < tmax)
Empty all tabu lists.
T1 VM1 Goto step 2
Else
Print current_optimal_solution.
T2 End If
VM2
9. Return
.
T3 . Algorithm 2: Scheduling based ACO algorithm
. .
Input: Incoming Cloudlets and VMs List
. VMn Output: Print “scheduling completed and waiting for more
. Cloudlets”Steps:
Tn VMs
1. Set Cloudlet List=null and temp_List_of_Cloudlet=null
Tasks
2. Put any incoming Cloudlets in Cloudlet List in order of their
arriving time
Figure 2. Problem representation of task scheduling based ACO. 3. Do ACO_P while Cloudlet List not empty or there are more
incoming Cloudlets
2. Heuristic Desirability: A very simple heuristic is Set n= size of VMs list
used the inverse of expected execution time of the If (size of Cloudlet List greater than n)
task i on VM j. Transfer the first arrived n Cloudlets from Cloudlet List
3. Constraint Satisfaction: The constraint satisfaction and put them on temp_List_of_Cloudlet
method is implemented as a simple, short-term Else
Transfer all Cloudlets.from Cloudlet List and put them on
memory of the visited VM, in order to, avoid visiting temp_List_of_Cloudlet
a VM more than once in one ACO procedure and End If
minimize time of the assigned couplings (task and Execute ACO procedure with input temp_List_of_Cloudlet
VM). and n
4. Pheromone Updating Rule: It is the one typical of End Do
ant system as shown in Equations 3, 4, 5, 6 and 7. 4. Print “scheduling completed and waiting for more Cloudlets”
5. Stop
Pheromone evaporates on all edges and new
pheromone is deposited by all ants on visited edges;
its value is proportional to the quality of the solution 4.1. Initializing Pheromone
built by the ants. The amount of virtual pheromone trail τij(t) on the
5. Probabilistic Transition Rule: The probabilistic edge connects task i to VMj. The initial amount of
transition rule, called random proportional, is the one pheromone on edges is assumed to be a small positive
typical of ant system as shown in Equation 1.
Cloud Task Scheduling Based on Ant Colony Optimization 133
Makespan
number of ants, tmax, Q, ρ, α and β) are shown from 60
Figures 3 to 8. It can be seen that the best value of α is 40
0.3, the best value of β is 1, the best value of ρ is 0.4, 20
the best value of Q is 100, the best value of tmax is 150 0
and the best values of m is 10. In the following 0 0.1 0.2 α 0.3 0.4 0.5
experiments we select the best value for α, β, ρ, Q and β=1, ρ=0.4, Q=100, tmax=100 and m=10.
m parameters but, the value 100 is selected for the tmax Figure 7. ACO performance for different values of alpha.
parameter to reduce the overhead of the ACO
algorithm. Table 2 shows the selected best parameters 120
100
of ACO. 100
73 72 73
80 67 67
Makespan
140 60
117
120 104 40
100 83 80 20
77 76
Makespan
80
0
60
0 0.5 1 1.5 2 2.5
40 β
α=0.3, ρ=0.5, Q=100, tmax=100 and m=10.
20
0 Figure 8. ACO performance for different values of beta.
1 5 8 M 10 15 20
α=1, β=1, r=0.5, Q=100, and tmax=200. Table 2. Selected parameters Of ACO.
Figure 3. ACO performance for different values of ant numbers. Parameter α β ρ Q m tmax
80
76
75
74
75 The following experiments, we compared the average
70
makespan with different tasks set. The average
makespan of the ACO, RR and FCFS algorithms are
65 shown in Figure 9. It can be seen that, with the
50 75 tmax 100 125 150 increase of the quantity task, ACO takes the time less
α=1, β=1, r=0.5, Q=100 and m=10. than RR and FCFS algorithms. This indicates that
Figure 4. ACO performance for different values of tmax. ACO algorithm is better than RR and FCFS
75.5
algorithms.
75
75
1200
74.5 74
Makespan
74 1000 FCFS
73.5 800 RR
Makespan
73 73
73 600 ACO
72.5
400
72
200
1 100 Q 500 1000
0
α=1, β=1, r=0.5, tmax=100 and m=10.
80 71 70.5
60
deviation (σ) shows how much variation or dispersion
40 exists from the average (mean), or expected value. A
20 low standard deviation indicates that the data points
0 tend to be very close to the mean; high standard
0 0.1 0.2
ρ
0.3 0.4 0.5 deviation indicates that the data points are spread out
α=1, β=1, Q=100, tmax=100 and m=10. over a large range of values (solving stagnation
Figure 6. ACO performance for different values of RHO.
problem). Since, the standard deviation of never drops
Cloud Task Scheduling Based on Ant Colony Optimization 135
to zero, we are assured that the algorithm actively Also, the comparison between our approach and other
searches solutions which differ from the best-so-far metaheuristics approaches will be performed.
found, which gives it the possibility of finding better
ones. Figure 10 shows the evolution of the standard References
deviation of the ACO over 10 runs.
[1] Boloor K., Chirkova R., Salo T., and Viniotis
7 Y., “Heuristic-Based Request Scheduling
6 Subject to a Percentile Response Time SLA in
Standard Deviation
5
a Distributed Cloud,” in Proceedings of the
4
3
IEEE International Conference on Global
2 Telecommunications Conference, Florida, USA,
1 pp. 1-6, 2010.
0 [2] Bonabeau E., Dorigo M., and theraulaz G.,
Swarm Intelligence: From Natural to Artificial
Number of Tasks Intelligence, Oxford University Press, New
Figure 10. Standard deviation of ACO over 10 runs. York, USA, 1999.
[3] Buyya R., Ranjan R., and Calheiros N.,
The Degree of Imbalance (DI) measures the “Modeling and Simulation of Scalable Cloud
imbalance among VMs, which is computed by Computing Environments and the CloudSim
Equations 8 and 9. Toolkit: Challenges and Opportunities,” in
TL _ Tasks Proceedings of the 7th High Performance
Ti = (8)
Pe _ num j * Pe _ mips j Computing and Simulation Conference, Leipzig,
Germany, pp. 1-11, 2009.
Where, TL_Tasks is the total length of tasks which are [4] Dorigo M. and Blum C., “Ant Colony
submitted to the VMi. Optimization Theory: A Survey,” in Theoretical
T max − T min
Computer Science, vol. 344, no. 2, pp. 243-278,
DI = (9) 2005.
T avg
[5] Dorigo M., Birattari M., and Stutzel T., “Ant
Where, Tmax, Tmin and Tavg are the maximum, minimum Colony Optimization,” IEEE Computational
and average Ti respectively among all VMs. The Intelligence Magazine, vol. 1, no. 4, pp. 28-39,
average DI of each algorithm with the number of tasks 2006.
varying from 100 to 1000 is shown in Figure 11. It can [6] Fangzhe C., Ren J., and Viswanathan R.,
be seen that the ACO can achieve better system load “Optimal Resource Allocation in Clouds,” in
balance than RR and FCFS algorithms. Proceedings of the 3rd International Conference
on Cloud Computing, Florida, USA, pp. 418-
4.5 425, 2010.
[7] Gao K., Wang Q., and Xi L., “Reduct Algorithm
Degree of Imbalance (DI)
4
3.5 FCFS
3 Based Execution Times Prediction in
2.5 RR Knowledge Discovery Cloud Computing
2
1.5
ACO Environment,” the International Arab Journal of
1 Information Technology, vol. 11, no. 3, pp. 268-
0.5 275, 2014.
0
[8] Gao Y., Guan H., Qi Z., Hou Y., and Liu L., “A
Multi-Objective Ant Colony System Algorithm
Number of Tasks for Virtual Machine Placement in Cloud
Figure 11. Average DI of FCFS, RR and ACO. Computing,” Journal of Computer and System
Sciences, vol. 79, no. 8, pp. 1230-1242, 2013.
[9] Ghalem B., Tayeb F., and Zaoui W.,
6. Conclusions and Future Work
“Approaches to Improve the Resources
In this paper, ACO algorithm for achieving cloud Management in the Simulator Cloudsim,” in
computing tasks scheduling has been presented. Firstly, Proceedings of the Conference on Interaction
the best values of parameters for ACO algorithm, and Confidence Building Measures in Asia,
experimentally determined. Then, the ACO algorithm Lecture Notes in Computer Science, Istanbul,
in applications with the number of tasks varying from Turkey, pp. 189-196, 2010.
100 to 1000 evaluated. Simulation results demonstrate [10] Hsu C. and Chen T., “Adaptive Scheduling
that ACO algorithm outperforms FCFS and RR Based on Quality of Service in Heterogeneous
algorithms. In future work the effect of precedence Environments,” in Proceedings of the IEEE
between tasks and load balancing will be considered. International Conference on Multimedia and
136 The International Arab Journal of Information Technology, Vol. 12, No. 2, March 2015