AbstractâCloud service providers such as Amazon Web ... Cloud computing is an emerging technology for providing ... Figure 1: Load Balancing in Cloud [9].
A Performance Comparison of Load Balancing Algorithms for Cloud Computing Tahira Islam
Mohammad S. Hasan
The Department of Computer Science and Engineering University of Dhaka Dhaka, Bangladesh
School of Computing and Digital Technologies Staffordshire University Stoke-on-Trent, UK
Abstract—Cloud service providers such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP) have seen exponential growth over the past few years as more companies are shifting their operations to the Cloud. As Cloud serves multiple clients and users simultaneously, it is important but challenging to estimate the performance of load balancing mechanisms for the tasks running on the Cloud. This research has investigated First Come First Served (FCFS), Shortest Job First (SJF) and Least Connection (LC) load balancing algorithms using CloudSim framework and realistic models for Cloud platform e.g. AWS, task etc. The simulation results show that the task execution time for space-shared scheduling policy is closer to the theoretical time than that of time-shared scheduling. Furthermore, it has been observed that LC performs better than SJF and FCFS at lower load. Keywords—CloudSim, Load balancing, FCFS, SJF, LC etc.
I. INTRODUCTION Cloud computing is an emerging technology for providing effective and efficient computational services to many organisations worldwide. Services offered by the Cloud can be Software as a Service (SaaS), Platform as a Service (PaaS) or Infrastructure as a Service (IaaS) which can be offered in private, public or hybrid Clouds. Cloud computing provides a solution to many challenges faced by small businesses by providing business agility, flexibility, disaster recovery, increased collaboration etc. Many of the “Fortune 500” companies such as Boeing, Land O‟ Lakes etc. have already moved their IT operations to the Cloud. According to a recent Forbes report, 74% of the interviewed technical Chief Financial Officers (CFOs) are expected to have Cloud computing knowledge to have the most measurable impact on their companies [1]. In the UK, the Cloud industry forum has conducted a research which found out that the overall Cloud adaptation rate is 84% among the British companies [2]. Popular Cloud-based application services nowadays include social networking, content delivery, web-based e-mail, other web hosting services such as Google docs, Flicker etc. Aside from the benefits provided by the Cloud service providers such as fast deployment, pay-for-use, rapid provisioning etc., there are a number of existing challenges such as load balancing of tasks, Virtual Machine (VM)
migration, server consolidation etc. Load balancing helps improving system performance by evenly distributing task load across different execution elements e.g. VMs. In this paper, a performance analysis for different load balancing algorithms i.e. First Come First Served (FCFS), Shortest Job First (SJF) and Least Connection (LC) in Cloud computing are carried out for comparison. As it is difficult, time-consuming and expensive to run the experiments on a Cloud, this paper has implemented realistic task and Cloud models to analyse the performance of load balancing algorithms using the CloudSim [3] simulation tool. The rest of the paper is organised accordingly. Section II presents the basics and relevant work carried out by researchers in the field of Cloud computing. Section III explains the model used to carry out the desired simulation. Section IV presents and analyses the results. Section V includes concluding remarks and future works. II. PRELIMINARIES AND PREVIOUS WORK With increasing number of Cloud computing providers, users are also increasingly using these services. Hence, problems regarding reliability, fast service etc. are always challenging issues [4]. Therefore, implementing load balancing is very important as it improves power consumption of resources and improves the reliability and efficient delivery of tasks [5]. Load balancing ensures that not all tasks are given to one VM and overloading it. Load balancing techniques must consider the amount of load each VM has by considering the amount of load in each VM, performance of the system, and distribution of load among all available VM [6] as shown in Figure 1. In other words, load balancing algorithms allocate surplus task from an overloaded VM to other VMs [7]. In addition, a load balancing policy should take into account the increasing user requests i.e. server load, an increase in CPU, memory. It should be scalable [8]. All in all, the main goals of a load balancing algorithm are scalability and flexibility, prioritisation, improved performance, stability of the system, cost-effectiveness, increase fault tolerance etc.
proposed scheduling model in a Cloud environment over a grid computing environment.
computing
III. SIMULATION MODEL The simulator, cloud platform model, task model, load balancing algorithms etc. for this investigation are explained below.
Figure 1: Load Balancing in Cloud [9].
Load balancing algorithms can be divided into the following two types. A. Static Load Balancing These types of algorithms work with a fixed established knowledge of the system like resources and number of tasks. They are not preemptive meaning that the VMs are always occupied by at least one task [9]. B. Dynamic Load Balancing With no knowledge of the previous state, these load balancers work with the current state. Therefore, it allows a process to be preempted which is not supported in static load balancing. This behaviour improves the overall performance of the system [9]. CloudSim, CloudAnalyst [10], GreenCloud [11] etc. are frameworks which allow modelling, experimentation and simulation of different Cloud-based infrastructures and services. A number of previous studies has been conducted where different algorithms for load balancing in a Cloud are proposed and implemented. In [12], a preemptive load balancing approach is proposed where resources usage is optimised but does not focus on time optimisation. A time optimised approach is discussed in [13]. The proposed method focuses on response time by finding the VM that can complete a task with the highest speed. In [14], Stochastic Hill Climbing Algorithm is used. VM id is randomly generated and checked for availability. Any available task is submitted but the progress is tracked. If the VM is unable to finish the given task, its probability to complete a task is reduced. In [15], a hybrid algorithm is developed from Round Robin (RR) and throttled algorithm for VM level load balancing. In the hybrid approach, the current loads of the existing VMs are taken into consideration when allocating a load to the VMs. It is found that the hybrid approach generates a better result in terms of overall response time when compared to the RR, throttled and equally spread current execution algorithm, respectively. The CloudSim framework has been used to propose a two-level task scheduling model based on load balancing techniques in [16]. Under the experimental setup, 100-1000 tasks have been executed in a Cloud as well as in a grid computing environment for comparison. The simulation carried out validates the advantage of resource utilisation using the
A. The simulator - CloudSim The research work has used CloudSim 3.0.3 for modelling the desired Cloud computing environment. CloudSim is one of the most popular open source frameworks for simulating different Cloud computing infrastructures and services. CloudSim acts as a substitute for real Cloud computing environment (Amazon EC2, Microsoft Azure, and Google Cloud Platform) for carrying out simulation works. CloudSim has a number of entities. 1) Cloud Information Service (CIS) The CIS acts as a registry for a datacentre (DC) which contains resources available in the Cloud. Each DC has a number of hosts and each host has a number of VMs. Once the DC registers with the CIS, the information regarding such entities are contained in the CIS. 2) Datacenter This is an architecture which powers Cloud resources such as servers and other hardware equipment. Companies like Microsoft and Amazon own and operate their own DC which stores massive data for clients and ensure the continuing services of their Cloud promises. Many companies own multiple DCs in different geographic locations to ensure redundancies against DC failures and allowing users from different locations to access the Cloud faster. The DC class in CloudSim models hardware and software level services offered by a Cloud service provider. Every DC component instantiates a provisioning component which in turn implements a set of policies for allocating bandwidth, storage, RAM etc. for the hosts. 3) Datacenter Broker A broker is an entity that acts as an intermediate between the Cloud resources and the users. The broker has all the information such as total number of VMs and their configurations like number of cores, RAM and storage capacity of each VM. All client requests are submitted to the broker and the broker uses load balancing to figure out to which VM the request should be submitted to. Upon completion, the broker receives the completed task before forwarding it to the respective client. 4) Host A Cloud host is a physical machine that resides inside a DC and provides hosting services. VMs are created on the hosts. For example, a host having 12 cores and 8GB Ram can host 4 VM with 3 cores and 2GB ram each or can host 2 VM with 6 cores and 4 GB of RAM each.
5) Virtual Machine (VM) Each host in CloudSim manages a set of VMs. Each VM possess a set of characteristics such as RAM, processor, storage, and its own internal provisioning policy. Internal provisioning policy is an extension of the abstract class called VMScheduling. CloudSim does scheduling based on one of the two policies – Space-Shared scheduling and Time-Shared scheduling. These policies are implemented at both VM and task level.
RAM, hard disk or SSD storage, web servers, databases etc. Start
Initialization of cloudsim packages
Set the number of users
Initialization of common variables
In VM space-shared scheduling policy [17], one complete CPU core is assigned to each VM. Only when the VM completes its task, the core is then assigned to another VM. Similarly, at the task space-shared scheduling policy, one task is executed at a time in a VM. No context switching takes place between tasks until the execution of current task finishes.
Creation of cloud Information Service (CIS)
Creation of Datacenter
Creation of Broker
In VM time-shared scheduling policy [17], all the VMs are assigned to the CPU core at the same time. Similarly in the task time-shared scheduling policy, all the tasks sent to the VMs for execution are scheduled at the same time. Therefore, context switching takes place between tasks during their execution. Figure 2 illustrates the space and time-shared scheduling policy for VM and tasks.
Creation of Virtual Machine (VM)
Creation of Cloudlets
Start simulation
Load Balancing Algorithms
Print Status
Stop Simulation
END
Figure 2: (a) Space-shared scheduling policy for both VM and tasks and (b) Space-shared scheduling policy for VM and Time-shared scheduling policy for tasks [17].
6) Tasks In Cloud computing, a task is defined as a job submitted to the Cloud for execution. Task attributes are task length, file size, arrival time, etc. It mainly models Cloud-based application services such as content delivery, social networking, and business workflow in CloudSim. By using the entities in CloudSim package, different types of simulations can be modelled in CloudSim. Figure 3 describes the steps employed to carry out a simulation in CloudSim by implementing a load balancing algorithm. B. Cloud model Amazon Web Services (AWS) provide on-demand Cloud computing services to many customers e.g. Air Asia, AOL, DLink, Hitachi etc. This paper applies a realistic task model and the load balancing algorithms explained in sections III.C and III.D, respectively to a simulation model of AWS for analysis. AWS technology implements VMs which possess attributes of a real computing system such as operating system, CPU,
Figure 3: Steps to carry out a simulation in CloudSim [18].
Amazon Elastic Compute Cloud (EC2) is a significant part of AWS. Using Amazon EC2, compute capacity can be scaled up or down as per requirement of the client. The Cloud model used for this research has modelled Amazon EC2 with specifications given in Table 1. Table 1: The Cloud model for the simulations. CPU Clock speed RAM Host Core
Intel(R) Xeon(R) E5-2673 v3 2.40GHz 1 GB 1 12
The processing power is considered as the number of instructions executed by a core in unit time i.e. Millions of Instruction per Second (MIPS). The MIPS value of the cores in the simulation is set using (1) where the average Clock Per Instruction (CPI) is 2 [19].
(1)
C. Task Model The tasks have been given the properties of a typical web server tasks. A web server responds to the incoming user requests by sending webpages in the client-server model. A regular web server handles a huge number of requests during a day. A web server load can be calculated in terms of a number of user requests being sent to the server in a period of time. According to [20], a typical web server handles around 200 requests per second (RPS). For a web server, the typical task execution time is between 200 ms to 500 ms [21]. Therefore, the lengths of the tasks are chosen randomly between 240 to 600 MIPS using (2).
D. Load balancing algorithms In Cloud computing, load balancing is the scheduling of different tasks which are expected to be executed inside VMs of different DC. This research work has implemented three fundamental load balancing algorithms namely FCFS, SJF and LC. How a load balancer distributes tasks across VM is illustrated in Figure 4. Cloudlet (s)
Data Center Broker
Datacenter
Host
Load balancer
(2)
The tasks are then sent to the VMs using the load balancing policies implemented. To observe how the task execution time varies with increasing load under space-shared scheduling policy and time-shared scheduling policy, the web server load is increased 5 times up to 1000 RPS with an equal interval. Therefore, 200, 400, 600, 800, and 1000 tasks have been generated with random arrival time in every second to simulate the web server load. Then the ratio of actual and estimated execution time for a task is calculated using (3). Ideally, the ratio should be 1. However, as in real world, the actual execution time can be longer than the estimated execution time, the ratio of actual and estimated execution time can be larger than 1. The estimated execution time is calculated using (4).
Cloudlet 1
VM 1
Cloudlet 2
VM 2
...
Cloudlet n
VM N
Figure 4: Load balancing in a Cloud setup.
1) FCFS FCFS is one of the simplest scheduling algorithms. As the name suggests, the tasks are executed on first come, first served basis. It is also known as „First In, First Out‟ i.e. the first task to enter the queue gets executed first by a VM [22]. tasks are submitted according to their arrival time and once a VM starts executing the task, it cannot execute another one until the current task is completed [23]. As Figure 5 illustrates that the executions of tasks are done in order of their arrival time and is not affected by the burst time of the tasks [24].
(3)
(4)
Each algorithm has taken into consideration the VM spaceshared scheduling policy and paired it with task scheduling policies as shown in Table 2. Table 2: Comparison scenarios for the load balancing algorithms. Algorithm FCFS SFJ LC
Taks Scheduling Policy CloudletSchedulerSpaceShared CloudletSchedulerTimeShared CloudletSchedulerSpaceShared CloudletSchedulerTimeShared CloudletSchedulerSpaceShared CloudletSchedulerTimeShared
Figure 5: FCFS Scheduling [25].
2) SJF This algorithm works with the length of the task. When a VM is available, SJF submits the task with the shortest length in the queue to the VM. If two or more tasks of the same length are queued then FCFS is applied [26]. Technically, SJF prioritises tasks based on their size making it a dynamic load balancing algorithm. SJF is optimal as its average time is minimal [27]. Figure 6 demonstrates SJF algorithm.
3) LC Like the previous algorithm, SJF, LC is also a dynamic scheduling algorithm. The algorithm submits task to the VM with the least number of tasks submitted thus far. This is achieved by comparing the sum of all the tasks each VM has [28]. The broker needs to keep a count of the number of tasks submitted per VM. The number is increased if a task is submitted and is decreased if a task has finished executing [8]. This is demonstrated in Figure 7.
expected for the VMs to take a longer time to execute a task than the estimated theoretical time because of the context switches among the tasks.
Figure 8: The ratio of actual and estimated execution time against increasing load in Space-Shared Scheduling Policy for SJF and LC. Figure 6: SJF scheduling [25].
Figure 7: LC scheduling [29].
IV. RESULTS AND ANALYSIS The experiment considers two case studies regarding the arrival time of the tasks. Firstly, all the tasks have the arrival time of zero. This is done to simulate a situation where a lot of tasks can arrive at a broker from different users at the same time. Secondly, tasks with different arrival times are considered, to simulate situations where a DC receives tasks at different times of the day.
Figure 9: The ratio of actual and estimated execution time against increasing load in Time-shared Scheduling Policy for SJF and LC.
B. Task arrival time between 0 and 1000ms For different arrival time, FCFS has performed equally to LC for higher loads e.g. 800 or higher for space-shared scheduling policy, as illustrated in Figure 10. This can be because as more tasks arrive to be executed, FCFS schedules them to the next available VM as soon as they arrive, rather than balancing load to the VMs as done by LC.
A. All task arrival time 0 Regarding zero arrival time, two load balancing algorithms i.e. SFJ and LC are used. Figure 8 shows the results for both the algorithms under different loads for space-shared scheduling policy. It has been observed that LC has executed all tasks within time closer to the theoretical time, for all types of load. This can be because, in LC the tasks are distributed evenly to all the VMs upon arrival, whereas in SJF the VM load is not taken into account. According to Figure 9, both SFJ and LC are performing similarly for all loads. The reason for such a high ratio of actual and estimated execution time is that in time-sharing scheduling policy, the tasks are sharing a VM. Hence, more than one task is being executed in a VM. Therefore, it is
Figure 10: The ratio of actual and estimated execution time against increasing load in Space-Shared Scheduling Policy for FCFS and LC.
Figure 11 paints a similar result for time-shared scheduling
policy where both FCFS and LC have performed equally. The reason is the same, as the tasks share a single VM, it takes longer to execute a task.
[8] [9] [10]
[11] [12]
[13]
[14] Figure 11: The ratio of actual and estimated execution time against increasing load in Time-Shared Scheduling Policy for FCFS and LC.
V. CONCLUSION Cloud computing is an area of research which is evolving very rapidly. Load balancing inside a Cloud environment leads to distributed workload which leads to maximum throughput in a minimized response time. In this paper, three fundamental load balancing algorithms are implemented in CloudSim to observe how the actual execution time of tasks differ under space-shared scheduling policy and time-shared scheduling policy for increasing number of tasks. In future, further analysis can be carried out by implementing different algorithms in a separate experimental setting.
[15] [16] [17] [18] [19] [20] [21] [22]
ACKNOWLEDGMENT The authors would like to acknowledge an Erasmus+ International Credit Mobility (ICM) fund for Bangladesh fund awarded to Dr Mohammad Hasan at Staffordshire University, UK in 2016.
[23] [24] [25]
REFERENCES [1] [2] [3] [4] [5] [6] [7]
“Forbes.” [Online]. Available: https://www.forbes.com/sites/louiscolumbus/2017/04/29/roundup-ofcloud-computing-forecasts-2017/#30548e8731e8. “UK Cloud adoptation rate.” [Online]. Available: https://www.cloudindustryforum.org/content/uk-cloud-adoption-rateclimbs-84-finds-new-research-cloud-industry-forum. “CloudSim.” [Online]. Available: http://www.cloudbus.org/cloudsim/. C. M. Zenon Chaczko, Venkatesh Mahadevan, Shahrzad Aslanzadeh, “Availability and Load Balancing in Cloud Computing,” IPCSIT, vol. 14, 2011. S. P. Jayant Adhikari, “Load Balancing The Essential Factor In Cloud Computing,” Int. J. Eng. Res. Technol., vol. 1, no. 10, pp. 1–5, 2012. A. M. Alakeel, “A guide to dynamic load balancing in distributed computer systems,” Int. J. Comput. Sci. Netw. Secur., vol. 10, no. 6, pp. 153–160, 2010. N. R. C. Manoranjan Dash, Amitav Mahapatra, “Cost Effective Selection of Data Center in Cloud Environment,” Spec. Issue Int. J. Adv. Comput. Theory Eng., vol. 2, no. 1, pp. 2319–2526, 2013.
[26] [27] [28]
[29]
S. Ray and A. De Sarkar, “Execution Analysis of Load Balancing Algorithms in Cloud Computing,” vol. 2, no. 5, pp. 1–13, 2012. H. Shoja, H. Nahid, and R. Azizi, “A comparative survey on load balancing algorithms in cloud computing,” 5th Int. Conf. Comput. Commun. Netw. Technol. ICCCNT 2014, 2014. Assoc. Prof. Rajkumar Buyya, “CloudAnalyst : A CloudSim-based Tool for Modelling and Analysis of Large Scale Cloud Computing Environments,” Distrib. Comput. Proj. Csse Dept., Univ. Melb., pp. 433–659, 2009. “GreenCloud.” [Online]. Available: https://greencloud.gforge.uni.lu/. G. Khanna, K. Beaty, G. Kar, and a Kochut, “Application Performance Management in Virtualized Server Environments,” 2006 IEEEIFIP Netw. Oper. Manag. Symp. NOMS 2006, vol. 20, no. D, pp. 373–381, 2006. M. Moradi, M. A. Dezfuli, and M. H. Safavi, “A new time optimizing probabilistic load balancing algorithm in grid computing,” ICCET 2010 - 2010 Int. Conf. Comput. Eng. Technol. Proc., vol. 1, pp. 232–237, 2010. B. Mondal, K. Dasgupta, and P. Dutta, “Load Balancing in Cloud Computing using Stochastic Hill Climbing-A Soft Computing Approach,” Procedia Technol., vol. 4, pp. 783–789, 2012. R. Somani and J. Ojha, “A Hybrid Approach for VM Load Balancing in Cloud Using CloudSim,” vol. 3, no. 6, pp. 1734–1739, 2014. Y. Fang, F. Wang, and J. Ge, “A Task Scheduling Algorithm Based on Load Balancing in Cloud Computing,” Lncs, vol. 6318, pp. 271–277, 2010. S. Choudhury, “Performance Analysis of VM Scheduling Algorithm of CloudSim in Cloud Computing,” vol. 7109, 2015. U. Singh and M. Ayushi, “CloudSim Simulator Used for Load balancing in Cloud Computing,” vol. 6, no. 4, 2016. “CPI.” [Online]. Available: https://software.intel.com/enus/node/544403. “RPS.” [Online]. Available: https://stackoverflow.com/questions/373098/whats-the-averagerequests-per-second-for-a-production-web-application. “Response time.” [Online]. Available: https://www.quora.com/Howfast-should-network-request-response-normally-take-from-server-toserver. C. Singh, “Load Balancing in Distributed System Using FCFS Algorithm with RBAC Concept and Priority Scheduling,” vol. 3, no. 6, pp. 33–39, 2014. B. Schiemann, “A new approach for load balancing in highperformance decision support systems,” Futur. Gener. Comput. Syst., vol. 12, no. 5, pp. 345–355, 1997. C. Science and P. Education, “A Comparison between FCFS and Mixed Scheduling,” vol. 4333, pp. 76–79, 2011. N. Xoxa, M. Zotaj, I. Tafa, and J. Fejzaj, “Simulation of First Come First Served (FCFS) and Shortest Job First (SJF) Algorithms,” IJCSN International J. Comput. Sci. Netw. ISSN, vol. 3, no. 6, pp. 2277–5420, 2014. S. Behzad, R. Fotohi, and M. Effatparvar, “Queue based Job Scheduling algorithm for Cloud computing,” vol. 4, no. 12, pp. 3785– 3790, 2013. R. K. Mondal, E. Nandi, and D. Sarddar, “Load Balancing Scheduling with Shortest Load First,” Int. J. Grid Distrib. Comput., vol. 8, no. 4, pp. 171–178, 2015. K. Al Nuaimi, N. Mohamed, M. Al Nuaimi, and J. Al-Jaroodi, “A survey of load balancing in Cloud Computing: Challenges and algorithms,” Proc. - IEEE 2nd Symp. Netw. Cloud Comput. Appl. NCCA 2012, pp. 137–142, 2012. “Least connection.” [Online]. Available: https://www.citrix.com/blogs/2010/09/04/load-balancing-hash-method/.