Using gravitational search algorithm enhanced by fuzzy for resource allocation in cloud computing environments
- 119 Downloads
The aim of this paper is to allocate resources to tasks and scheduling tasks on existing virtual machines (VMs) in cloud environments, so that the time to finish the last work and average of all tasks execution time are minimized, and loads are distributed balanced on virtual machines. Since task scheduling in the cloud environment is a continuous process, so scheduling improvements, although slight, play an important role in cloud efficiency. On the other hand the resource allocation problem in cloud computing and user tasks scheduling on existing virtual machines is a NP-hard problem, and traditional algorithms requires exponential time to examine search space of this problem in sequence and finding the best answer, therefore we used Gravitational Search Algorithm (GSA) that has a high efficiency in solving nonlinear problems, for solving this problem. To do this, we create masses by combining sequences of tasks assigned to all machines. Each mass position is a solution of the problem. Then we find the best possible assignment using the gravitational search algorithm. We used fuzzy logic to determine the number of masses that affect one another during the implementation of the GSA. To calculate the cost, we use a combination of Make_ span (Time to finish the last task) and Mean_ Flow_Time (Average of all tasks execution time) and Load_ imbalance. The results show that the proposed method achieves more optimal response than genetic algorithm and GSA without fuzzy for resource allocation. It means that proposed algorithm allocated resources to tasks with less make span and mean_ flow time and more load balancing than other two algorithms.
KeywordsCloud computing Gravitational search algorithm (GSA) Resource allocation Tasks scheduling Fuzzy logic
Cloud computing is a computational model based on Internet that provides a fresh model for the supply, consumption and delivery of computing services (including infrastructure, software, platform, and other computing resources) by utilizing the network. In cloud computing, resources such as disk, network, RAM, and processor, or services such as a database, according to customer needs, are provided online.
Clouds are divided into several categories based on the type of service they provide: Infrastructures as a Service (IaaS), Platforms as a Service (PaaS) and Software as a Service (SaaS). Iaas is a combination of the hardware and services needed to run the cloud. Paas is a computing platform and a set of applications to an enterprise by a cloud provider. SaaS is a software distribution that is hosted by the service provider and used by users online .
One of the most important issues in cloud computing is how to allocate resources (such as CPU, Memory) to user requests. Virtualization is generally used to allocate resources in the cloud environment. A tasks scheduler is used to map each task to virtual machines (VMs) to minimize a given cost function. Cost can be power/energy consumption  or make-span, that is, the time when finishes the latest task, or flow-time, that is, the sum of initialization times of all the tasks .
The problem of resource allocation in cloud computing and user tasks scheduling on existing virtual machines is a NP-hard problem . So the search space for this problem is so large that if an algorithm wants to examine this space in sequence and find the best answer, it requires exponential time. Therefore, intelligent and heuristic methods and algorithms are used to solve this problem.
Main issue in cloud computing is resource deficiency. Therefore, maximizing the utilization of resources at same time minimizing the make span is an important object . One way to increase utilization of resource and consequently increase cloud throughput is to avoid overloading on resources and balancing load on them. On the other hand, the service level agreement (SLA) for cloud environment uses the average response time to reflect the Quality of Service (QoS) and cloud users want this time to be minimal. Therefore, in a good scheduling method, minimizing make span (time to finish the last task) and minimizing average of all tasks execution time and maximizing load balancing should be considered.
Task scheduling and resource allocation in the cloud environment are continuous processes, so scheduling improvements, although slight, play an important role in cloud efficiency. Since the task scheduling problem is a nonlinear problem and Rashedi et al.  have shown that the Gravitational Search Algorithm (GSA) has a high efficiency in solving nonlinear problems, and results obtained by GSA in most cases provide superior results and in all cases are comparable with other algorithms such as Particle Swarm Optimization (PSO) and Genetic algorithm (GA), so in this study we used GSA for task scheduling to achieve mentioned purposes. To increase the accuracy of the algorithm, we used fuzzy logic in our proposed method to determine the number of masses that affect one another during the implementation of the GSA. The results show that proposed method, in comparison with the Genetic Algorithm (GA) and GSA without fuzzy enhancement, receives roughly more optimal responses for resource allocation and it allocated resources to tasks with less make span and mean_ flowtime and more load balancing than other two algorithms.
In next section, a brief summary of tasks scheduling in Cloud environments is presented. In Sect. 3, we explain necessity to improve scheduling methods and describe problem statement. Section 4 gives an overview of GSA. In Sect. 5, how using enhanced GSA by fuzzy for resource allocation is mentioned, and in Sect. 6 achieved results are given.
2 Related works
Scheduling is one of the key issues of optimization and has an important role in increasing the reliability of the system. The main purpose of the scheduling is to allocate resources to the tasks and to find the proper sequence of the tasks to execute with appropriate time . Since the application of cloud computing is increasing andas mentioned finding an optimal solution for the tasks scheduling is a NP-hard problem, in recent years, tasks scheduling techniques for cloud environment received great attention from the researchers.
In  a scheduler has been proposed using the particle swarm optimization (PSO) algorithm to schedule tasks and allocate resources to tasks, which uses this scheduler less time consuming than the Best Resource Selection (BRS) algorithm.
Lakra and Yadav , proposed a multi-purpose tasks scheduling algorithm for tasks mapping to VMS to increase the efficiency of the data center and reduce costs without violating the SLA (Service Level Agreement). This method is simulated using Cloud Sim simulator and results show throughput improvement.
Li et al.  presented a method for scheduling tasks in cloud environments based on ant colony optimization (ACO) algorithm. The main goal of this proposed algorithm is to balance the entire system load while minimizing the time it takes to end the last task.
Priya et al  proposed a fuzzy multidimensional resource scheduling model to increase the resource scheduling efficiency in the cloud by introduce a resource scheduling and load balancing algorithm.
In , Mansouri et al. proposed a hybrid method using fuzzy system and particle swarm optimization (PSO) algorithm to increase load balancing and cloud throughput. In their study, they used fuzzy system for calculating fitness with some input factors such as tasks length, speed of CPU, size of RAM, and execution time. In their paper, the combination of crossover and mutations operators with POS algorithm is used to improve optimization performance. The experimental results show that the proposed algorithm has a better performance comparing to other methods in some terms such as imbalance degree and make span.
Jena and Mohanty  using Genetic algorithm to task scheduling in multi-cloud computing. The aim of their paper is to map the tasks to VMs in order to have maximum customer consent and minimum time that needs to finish the last task. They first using Genetic algorithm to map tasks to the virtual machines and then schedule tasks by using shortest job algorithm. The results show that the proposed algorithm efficiency is more than existing algorithms.
Muthulakshmi and Somasundaram  integrate the simulated annealing (SA) and artificial bee colony (ABC) algorithm to scheduling the tasks according to their size and priority of the request and distance between client nodes to a server in the cloud environment. They use Cloud Sim tool too simulation the results. The results show that the proposed algorithm is more efficient in terms of reduced make span.
3 Problem statement
As mentioned in the introduction section, tasks scheduling is one of the most important issues in cloud computing. For cloud providers, a good scheduling should reduce costs and avoid overloading on resources to increase system efficiency. From the cloud user’s view, make span and the average of all tasks execution time should be minimized. Therefore, to satisfy the interest of both groups, the proposed algorithm should consider minimizing make span and average of all tasks execution time and maximizing utilization of resource by balancing load on them.
Task scheduling and resource allocation in the cloud environment are continuous processes, so scheduling improvements, although slight, play an important role in cloud efficiency. Since task scheduling is a nonlinear problem and GSA has a high efficiency in solving nonlinear problems, therefore in this paper we used GSA for task scheduling to satisfy optimization constraints.
In our proposed method, physical resources are shared among several tasks using virtualization. Virtual resource requests are described by a set of parameters, including CPU, Memory and other resources requirements. The cloud provider satisfies a request by mapping virtual resources to physical ones. The resources are allocated to tasks on demand basis. Each VM can process several tasks at a time, but no two VM process the same task at a time.
Here we apply GSA to allocate virtual machines to tasks and used fuzzy logic to improve GSA Performance. We used combination of Make _span (Time to finish the last task) and Mean _Flow_Time (Average of all tasks execution time) and Load _imbalance as cost function in GSA and attempt to minimize this function value and consequently maximize fitness value of masses.
4 Gravitational search algorithm (GSA)
There are four main forces in nature. Gravity, weak force, electromagnetic force and strong force . Among these forces, the gravitational force is weaker than the others, but it has the fate of the universe. The gravitational force is very comprehensive and covers the entire universe while other forces are local.
In the gravitational search algorithm (GSA), optimization is done with the aid of a plan of gravitational laws and motion in a discrete time artificial system . The system environment is the same as the range of the problem definition. Under gravity law, each mass recognizes the location and condition of other masses through gravitational law. Therefore, this force can be used as a means of exchanging information.
In the first step, the system space is determined. The environment consists of a multi-dimensional coordinate system in the problem space. Every point in space is a solution to the problem. The search agents are a collection of masses. Each mass has four characteristics: (a) mass position, (b) active gravity mass, (c) inactive gravity mass, and (d) inertia mass. The amounts of gravitational and inertial masses are determined by the fitness of each mass.
In the Eq. (6), randi is a random number that distributed uniformly in the interval [0–1], which is used to maintain the randomness feature of the search algorithm.
In Eq. (9), G0 isthe initial gravitational constant, α is a positive constant and t is the total of algorithmic repetitions.
In Eq. (11), fiti(t) represents the amount of fitness of mass i at time t.
5 Using GSA enhanced by fuzzy for resource allocation in cloud computing environments
As mentioned the problem of tasks scheduling on existing virtual machines in cloud environment is a NP-hard problem. If we show the number of tasks with Tas knum and the number of virtual machines with VMnum, then the number of possible allocations is VMnumTasknum. The duty of scheduler is finding an allocation of virtual machines to input tasks such that the computational and memory requirements of all tasks are satisfied with the lowest cost.
Make span: Time to finish the last task
Mean (Flow-Time): Average of all tasks execution time
Cost can be a combination of these parameters.
For scheduling, we can use traditional algorithms such as Round Robin algorithm, but because they have a serial structure, offer only possible responses that are not necessarily optimal or relatively optimal. Also do not meet the load balance criterion.
As noted above, the problem of scheduling and allocating resources in the cloud is a NP-Hard problem and due to the size of the search space, the time needed to check the entire space sequentially and find the best answer is required exponential time. Because of the good performance of GSA in nonlinear problems, we used this algorithm for tasks scheduling in Cloud environment.
Any allocation that has more fitness will be a better allocation.
After formulating allocations, we use the gravitational search algorithm to find an optimal allocation.
In this equation rand j is a random number with a uniform distribution in the interval [0, 1] and used to maintain the randomness of the search.
Because in the initial repetition of the algorithm, there is a need for pervasive search, so in most papers often the start time affects all the masses on one another, and over time, the number of members affecting the population is reduced by a linear ratio, until the end, few of the best of the population affect to other members. Here we used fuzzy logic to control and adjust the k parameter. Our general policy for determining k is that if the optimal answer of the algorithm does not change significantly in much iteration, then we increase the value of k so that more masses can affect each mass. This makes it possible for a mutation to occur and the algorithm does not get stuck in the local optimal. Also, when the problem response variations are high, we reduce the k value to avoid wasting time and increasing the convergence speed of the algorithm.
In Eq. (29), randi is a random number with a uniform distribution in the interval [0, 1] and used to maintain the randomness of the search.
As mentioned, in the Allocated array, the tasks numbers are stored, and since each task only runs on one machine, we scaled the values obtained in Eq. (30) in such a way that they are placed in the interval [1, Tasknum] and there are no duplicate values in the Allocatedi array members.
In this Equation, G0 is the initial gravitational constant, α is a positive constant and T is the total of algorithm repetitions, that is, the system lifetime.
The proposed method is summarized in the pseudo-code as follows:
In this section, we compare the responses from the implementation of the proposed method to the responses obtained using the GSA without fuzzy enhancement and using genetic algorithm. To run the algorithm we used a system with CPU = core i7 4800MQ, RAM = 8 GB, VGA = AMD Radeon HD 8790 M with 2 GB Dedicated Memory. To test the proposed method, we first create virtual machines with random numbers of each of the available resources using a function called create vms. Also, by creating a function called create tasks, we create number of arbitrary tasks with random numbers of each of the available resources.
Each time we compare the proposed algorithm with the mentioned algorithms, we use the same virtual machines and the same tasks. In this way, before each comparison, we call the mentioned functions for creating virtual machines and tasks.
For the first comparison, we put G0 = 100 and α = 2. First, we create 100 masses randomly. For the genetic algorithm, we also consider the Crossover’s probability to be 0.3 and the mutation’s probability to be 0.2. We also consider the initial population to be 100.
Since resource allocation and tasks scheduling problem in cloud environment is a NP-hard problem and previous studies showed that GSA has a high efficiency in solving nonlinear problems, so in this study we used GSA for resource allocation in cloud environment. For this, first we coded problem responses in some arrays that each code showed a sequence of tasks assigned to each machine. Here we used combination of Make_ span and Mean _Flow_ Time and Load_ imbalance as cost function in GSA and attempt to minimize this function value and consequently maximize fitness value of masses. To increase the accuracy of the algorithm, we used fuzzy logic to determine the number of masses that affect one another during the implementation of the GSA and then continue the other steps of the GSA. The results show that proposed method, in comparison with the Genetic Algorithm (GA) and GSA without fuzzy enhancement, receives roughly more optimal responses for resource allocation and it allocated resources to tasks with less make span and mean_ flow time and more load balancing than other two algorithms. Although the proposed method often converges to the optimal response in less number of iterations than the GA and makes the GSA algorithm not get stuck in the local optimum. Future works can include other parameters such as the number of tasks to be completed per unit of time in terms of cost. Also to increase the speed of the algorithm and reduce the number of iterations, for k best determining, time is also considered as the input of the fuzzy system so that time has verse effect on k best.
Compliance with ethical standards
Conflict of interest
The authors declare that they have no conflict of interest.
- 2.Nguyen T, Quang-Hung N, Tuong NH, Tran VH, Thoai N (2013) Virtual machine allocation in cloud computing for minimizing total execution time on each machine. In: International conference on computing, management and telecommunications (ComManTel), Ho Chi Minh City, pp 241–245. https://doi.org/10.1109/ComManTel.2013.6482398
- 3.Carretero J, Xhafa F, Abraham A (2006) Genetic algorithm based schedulers for grid computing systems. Int J Innov Comput Inf Control 3:1053–1071Google Scholar
- 7.Zhao C, Zhang S, Liu Q, Xie J, Hu J (2009) Independent tasks scheduling based on genetic algorithm in cloud computing. In: 5th International conference on wireless communications, networking and mobile computing, Beijing, pp 1–4. https://doi.org/10.1109/WICOM.2009.5301850
- 8.Pandey S, Wu L, Guru SM, Buyya R (2010) A particle swarmoptimization-based heuristic for scheduling workflow applications in cloud computing environments. In: 24th IEEE international conference on advanced information networking and applications, Perth, WA, pp 400–407. https://doi.org/10.1109/AINA.2010.31
- 10.Li K, Xu G, Zhao G, Dong Y, Wang D (2011) Cloud task scheduling based on load balancing ant colony optimization. In: Sixth annual chinagrid conference, Liaoning, pp 3–9. https://doi.org/10.1109/chinagrid.2011.17
- 15.Holliday D, Resnick R, Walker J (1993) Fundamentals of physics. Wiley, HobokenGoogle Scholar