An efficient cloudlet scheduling via bin packing in cloud computing

In this ever-developing technological world, one way to manage and deliver services is through cloud computing, a massive web of heterogenous autonomous systems that comprise adaptable computational design. Cloud computing can be improved through task scheduling, albeit it being the most challenging aspect to be improved. Better task scheduling can improve response time, reduce power consumption and processing time, enhance makespan and throughput, and increase profit by reducing operating costs and raising the system reliability. This study aims to improve job scheduling by transferring the job scheduling problem into a bin packing problem. Three modifies implementations of bin packing algorithms were proposed to be used for task scheduling (MBPTS) based on the minimisation of makespan. The results, which were based on the open-source simulator CloudSim, demonstrated that the proposed MBPTS was adequate to optimise balance results, reduce waiting time and makespan, and improve the utilisation of the resource in comparison to the current scheduling algorithms such as the particle swarm optimisation (PSO) and first come first serve (FCFS).

INTRODUCTION Cloud computing provides on-demand services, including networks, servers, storage, and applications through its massive and effective computing paradigm. The National Institute of Standards and Technology (NIST) defines it as a developing technology that frequently offers accessible and on-demand network access to shared computing resources [1]. The typical models of the cloud are: infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS) [1]. Apart from that, task scheduling, which has gained traction nowadays, introduces the option of choosing the resources distribution between various tasks. It should be noted that each workflow or tasks may have scalable scheduling on multiple virtual machines (VMs). Regarding task scheduling, its nondeterministic polynomial time (NP) nature may cause issues that stemmed from the resources' unstable characteristics and dynamic nature [2]. In the process, the task scheduler accepts the queued tasks from the users and assigns the tasks to available resources based on the task resources parameters [2]. The research problem is to improve task scheduling in cloud computing by reducing the execution time of queuing tasks and enhancing the use of resources.

Int J Elec & Comp Eng
ISSN: 2088-8708 ❒ 3227 There have been many studies recently on ways to improve task scheduling in cloud computing. The studies rely on algorithms that demonstrate their efficiency in task scheduling. For reducing energy consumption and making a whole system live longer, Kumar and Alam [3] proposed a novel scheduling algorithm based on dynamic voltage scaling (DVS) and earliest deadline first (EDF) algorithm. Ouhame and Yadi [4] proposed a new technique to improve the data allocation system in virtual machine (VM) for cloud computing based on a modified grey wolf optimization algorithm. Aziz and Ninggal [5] propose a failure-aware workflow method for scheduling parallel applications to improve the reliability and makespan metrics on homogeneous systems. To improve the makespan, Aziz et al. [6] developed a failure-aware workflow scheduling algorithm to reprocess the failed job and assign them to the unused resources. It is also observed that the total cost can be reduced through an energy consumption model that is composed of the processor's execution and transmission cost [7]. Furthermore, the improvement of the load deviation, the resource utilisation (RU) and the makespan can be achieved through the proposed algorithm in the paper [8] denoted hybrid load balance based on genetic algorithm (HLBGA). Similarly, resource utilisation, load balancing, and excellent performance can also be achieved by implementing a novel architecture that is based on the particle swarm optimisation (PSO) and the dynamic dispatch queues algorithms [2]. Moreover, Harun et al. [9] introduced a genetic algorithm GA-based task scheduler algorithm for a mobile robot in the ground to find the optimum global travel itinerary for picking and delivering products at different locations. The execution time of task scheduling and the throughput of cloud computing can also be improved through a novel dynamic task scheduling algorithm using GA by considering the scalability of the cloud [10]. In addition, the total execution time can also be reduced by using the algorithm introduced by Gabi et al. [11] that is based on the orthogonal Taguchi-based cat swarm algorithm. Apart from that, the hybrids of simulated annealing (SA) with PSO and fuzzy logic with PSO have been demonstrated to impact makespan, waiting time, and other metrics positively [12]. Also, in order to reduce the waiting time of tasks in a queue's set, another smart scheduler is proposed by Abdalkafor and Alheeti in the paper [13]. Additionally, to improve the latency, response time, and amount of data used in a fog node Alsmadi et al. [14] proposed a RR based scheduler. To minimise the overall execution time of a set of tasks of a directed acyclic graph (DAG), Edward and Elcock [15] proposed an algorithm based on the ant colony optimisation (ACO) algorithm denoted ranking-ant colony system (rACS). Krishnadoss and Jacob [16] proposed a hybrid algorithm for task scheduling based on oppositional-based learning and Cuckoo search algorithm to assign users tasks and minimise the cost and makespan of the system. Khorsand and Ramezanpour [17] proposed an improved task scheduler based on the best-worst methods (BWM) and the technique for order preference by similarity to ideal solution (TOPSIS) to optimise metrics like energy consumption, makespan. In [18] developed an efficient task scheduling method to enhance resource efficiency and fault tolerance utilising a dynamic load-based distributed queue for dependent jobs. In [19] developed an ACO method to select the best virtual machine for executing a cloudlet to reduce energy consumption and execution time. We also proposed two tasks scheduling works [20] and [21]; the first accelerated the PSO task scheduling algorithm, and the second improved the makespan and other performance metrics using deep q-learning.
As solutions, this study proposes and compares novel alternatives with PSO. The proposed alternatives were acquired by converting the task scheduling problem into a bin packing problem. In addition, the bin packing algorithm was utilised by comparing measures of task scheduling such as waiting time, makespan, and resource utilisation. In order to improve the reliability of the proposed method, we compare the results of our proposed algorithms with the PSO, the most popular algorithm in the scheduling field. We also used the first come first serve (FCFS), which is the default scheduling algorithm used in CloudSim. Section 2 of this paper describes studies related to the current research, while section 3 describes the proposed algorithms, in which its experimental setup and simulation results are discussed in section 4, section 5 concludes the paper.

2.
PROPOSED TASK SCHEDULING ALGORITHMS 2.1. Task scheduling problem Task scheduling is an essential approach in cloud computing to resolve many issues, especially the overlay of cloud provider on the users' requirements such as maximum profit and quality of service (QoS) [22]. The cloud provider attempts to minimise waiting time and effectively utilise the VMs while simultaneously minimising the makespan. Figure 1 shows that a significant set of distinct tasks with varying parameters are raised by various users for the cloud provider to manage, which are later assigned to the available VMs.
In this regard, various optimisation algorithms are used to fully utilise VMs and find a better approach where, V M j is the VM j, Cloudlet i is the processing power of task i in million instructions per second (MIPS) and Ex j (Cloudlet i ) is the execution time of cloudlet i on V M j , M akespan is the overall execution time. Figure 2 shows an example of the process using FCFS algorithm where the number of VMs is 2, and the number of tasks is 7.

Bin packing
Bin packing problem is an infamous issue in combinatorial optimisation [24]- [26]. It pertains to the given n objects (items) of various values and containers (bins). Each has a max capacity C max . The primary purpose is to allocate each object to a container in ways that will minimise the total number of used containers. It can be considered that the objects have smaller values than container capacity. The following (3) is used [27]: where, y i = 1 shows that container i is operated (y i = 0 otherwise), and x ij shows that object j should be packaged in container i and w j the weight of object j. In addition, the constraint each object j is packed just one time, while inequalities n j=1 w j x ij ≤C max × y i ensure that the capacity C max constraint is respected for all containers that are used [27]. Figure 3 illustrates the bin packing problem. We have seven initial objects of different sizes that we want to optimally place on the four given containers to use only a few of them.

Proposed algorithms
This study focuses on a novel method for task scheduling based on bin packing problem algorithms such as first-fit, next-fit, and best-fit algorithms [28]. It aims to improve efficiency through makespan optimisation, reducing waiting time, improving load balancing, and increasing resource utilisation. The approaches proposed in this study intent on reformulating the task scheduling problem to construct a bin packing problem by considering the VMs as bins with a max capacity C max , in addition to considering the tasks as items to be placed into those bins based on their length of tasks, which is also referred to as the weight of the item. The proposed approaches also aim to minimise makespan -the maximum capacity to be used in the bin packing problem -instead of minimising the number of bins. The maximum capacity of the bins is calculated using the proposed (4) which we consider as the perfect makespan to approach. Where, T i represents the average execution times of task i on each available VM, m denotes the number of available VMs, while n is the total number of tasks.
After defining the bin packing parameters, the bin packing algorithm is implemented to solve the problem. Figure 4 describes the workflow of the whole scheduling process, where our proposed work is the used scheduler. Following are three modified algorithms to be used to solve the problem of tasks scheduling and integrated essentially in the cloud broker. We iterate the first and second algorithms based on the total number of tasks. The third algorithm was iterated depending on the total number of tasks and the total number of VMs.  The first proposed modified bin packing algorithm (MBPTS-1) begins with sorting all tasks in descending order and then placing each task in the right bin based on algorithm 1. To understand the MBPTS-1 algorithm, we consider six tasks and three VMs with the same processing power as shown in Figure 5, where i is the number of iterations. We iterate over each task in the ordered list and place the selected task in the next VM based on its defined order {1, 2, 3}. Each time we get to the end of the VMs list, we set the counter back to the beginning of the VMs list until we finish all given tasks in the queue. We sum the execution times of tasks ❒ ISSN: 2088-8708 in each VM and get the biggest value. Figure 5 shows that VM3 has the biggest bin value (makespan) with a total length of 7;2+5=7.

Second proposed algorithm
The second proposed modified bin packing algorithm (MBPTS-2) begins with sorting all tasks in descending order. Then, the tasks are placed in the bin in reversed order each time the last container arrives (refer to algorithm 2). For the MBPTS-2 algorithm, we apply the same dataset in the example of the first proposition. Figure 6 shows an example of the MBPTS-2 algorithm. We iterate over all ordered tasks in the queue based on the index i. First, we place each selected task from the queue in the next VM based on its defined order {1, 2, 3}. Each time we reach the beginning or the ending of the VMs list, we reverse the iteration order over VMs. The first three tasks are placed in VM1, VM2 and VM3, respectively. The following three tasks are placed in VM3, VM2 and VM1, respectively, and we reverse the selected VM order in each following three given tasks. Figure 6 shows that the VM2 has the most considerable bin value (makespan) with a total length of 6.5; 2+4.5=6.5.

Third proposed algorithm
The third proposed modified bin packing algorithm (MBPTS-3) begins with sorting all tasks in descending order and then placing each task in the right bin based on the bin's maximum space (refer to algorithm 3 in Appendix). Figure 7 shows an example of the MBPTS-3 algorithm considering the same dataset in the first proposition. At this time, we place each task based on the maximum capacity C max , which we calculated in (4). In the example the max capacity is (2 + 3 + 5 + 4.5 + 1 + 2) / 3 = 5.83. For each iteration i, we iterate over all given VMs to find the maximum available space and place the task into it. The available space of a VM is the C max minus the execution time of a VM in the current iteration i. If two or more maximum available spaces are equals, we select the VM based on its defined order. Finally, we sum the execution times of tasks in each VM and get the biggest value. The VM1 has the biggest bin value, with a total length of 8; 1 + 2 + 5 = 8 as shown in Figure 7. ET ← descSort(ET ) // Sort execution times in descending order binsData ← (0, . . . , 0) // List of bins size initialised with zeros reverseOrder ← F alse // A variable to reverse order of iterations over bins for i = 0; i < size(ET ); i = i + 1 // Iterate over execution times do k ← i mod N // k is for iterating over bins data // Sum with previous data end makespan ← max(binsData) // Find the biggest value in binsData return makespan End Function

. Experimental setup
A simulation was created using the CloudSim simulator [29] to test the proposed implementation against other algorithms. CloudSim tasks (cloudlets) are defined according to their specifications, such as its utilisation model, the number of processing elements, and their processing power in millions of instructions (MI). Cloudsim employs space-shared and time-shared policies for job units scheduling [29]. In this study, the time-shared policy was used to execute different tasks instantaneously within the same host. The simulation was a part of the cloud broker and had the characteristics as presented in Table 1.   The characteristics are defined by CloudSim Feitelson et al. [30] example 6 of the provided source code, and the tasks are taken from the generated standard formatted workload "high performance computing center north (HPC2N) Seth Log". Following example 6 and the used workload facilitate the reproducibility of the results of our proposed work. Furthermore, to compare our proposed algorithms, we used the PSO algorithm [31] as a popular algorithm used by many studies in the task scheduling field. We also used The FCFS, the default scheduling algorithm used in CloudSim specified in [29]. The original PSO implementation is not developed for particular optimisation issues like task scheduling. Therefore, a binary version of the PSO algorithm was proposed [32]. The PSO implementation for task scheduling proposed in Figure 2 is used based on the parameters described in Table 2. The experiments were done in a CPU Intel(R) Core(TM) i7-6500U and coded in Java language.

Experiments and results analysis
The presented algorithms' efficiency was assessed by repeatedly executing those algorithms using different parameters and independent cloudlets. Their performance was evaluated based on the makespan of many sets of tasks. In PSO, Al-Olimat et al. [33] run the simulation 100 times and compute the average makespan; our proposed algorithms need to run only once to compute the makespan. Figure 8 shows the results of executing the three proposed algorithms, PSO, FCFS and the perfect makespan calculated in (4), which we are trying to approach to its value. This execution is evaluated in terms of the makespan. We increase the number of tasks in each execution to prove the suggested algorithms' efficacy. As illustrated in Figure 8, the makespan increases with the number of tasks. The makespan of the three proposed algorithms was observed to be better than the PSO and FCFS algorithms, with MBPTS-2 taking the lead. The MBPTS-2 also had a nearperfect makespan. Taking the makespan as an objective of our proposed work helped us in the improvement of other metrics such as the average waiting time, the average resource utilisation, and the DI: The cloudlets were queued and executed based on scheduling algorithms, in which the waiting time algorithm was used to calculate all cloudlet sequences' waiting times and the average waiting time as seen in (5), where W T i is the waiting time of the cloudlet i, and n is the queue's length.
The outcomes of executing the three suggested algorithms, PSO and FCFS, in terms of the average waiting period are seen in Figure 9. As shown in Figure 9, the proposed algorithms provide optimised solutions that can increase the speed and efficiency in managing the cloudlets' queue by reducing waiting time and queue length, with MBPTS-2 taking the lead in waiting time.

Average degree of imbalance (DI)
The degree of imbalance calculates the imbalance among VMs and is an essential QoS metric in proving task allocation efficiency and load balancing between VMs. In this study, it is calculated using (6), where, ET min , ET max , ET avg correspond to the minimum, maximum, and average execution times of all VMs, respectively. The scheduling issue's objective aims to reduce DI as a low DI represents a more balanced system [34].
The results of implementing the three suggested algorithms, FCFS, and PSO, in terms of DI are seen in Figure 10. As shown in Figure 10, the proposed modified bin packing algorithms can achieve good load balance and reduce the time to execute tasks, making them superior to the PSO and FCFS algorithms. It is also observed that MBPTS-2 has the best average DI.

Average resource utilisation (ARU)
The average resource utilisation (ARU) is essential in task scheduling as high utilisation of resources is desirable. It is calculated using 7 [23], ❒ ISSN: 2088-8708 where, Ex V Mi is the duration taken by the V M i to complete every given cloudlet, and N is the total number of VMs. Figure 11 demonstrates the execution of the three proposed algorithms against the PSO and the FCFS algorithms regarding resource utilisation. Figure 10. Average DI with a different number of cloudlets Figure 11. Average resource utilisation with a different number of cloudlets Figure 11 demonstrates that the proposed algorithms outperform PSO and FCFS algorithms in terms of resource utilisation as the resources are occupied while scheduling tasks. Such quality is valuable for service providers in acquiring maximum profit by renting limited resources. It is also observed that MBPTS-2 has the best average resource utilisation.
To monitor the efficiency of our proposed work much more, especially MBPTS-2, which is taking the lead, we calculate the percentage improvement of each set of tasks for the proposed MBPTS-2 versus PSO and FCFS in terms of makespan, DI, RU, and waiting time. The results are presented in Table 3. We notice that the proposed MBPTS-2 has shown a decrease in the makespan, DI and waiting time and an increase in resource utilisation metric, proving that the proposed MBPTS-2 is successful. We can also see the difference between every percentage in each set of tasks due to the variation of the task lengths. To summarise, the three proposed algorithms outperformed the PSO and the FCFS in terms of makespan, our primary objective, and optimised better the others metrics such as the waiting time, resource utilisation, and degree of imbalance. Furthermore, unlike the method presented in paper [33], where Al-Olimat et al. run the simulation 100 times and report the average makespans, our proposed method only needs to be run one time.

CONCLUSION
Efficient task scheduling is considered one of the major cloud services concerns. An effective scheduler is needed to improve the task scheduling metrics when it comes to larger tasks size. A Better task scheduling ameliorates response time, minimises power consumption and processing time, enhances makespan and throughput, and increases profit by reducing operating costs and raising system reliability. This research presents an efficient task scheduling implementation via the bin packing problem in cloud computing by proposing three modified bin packing algorithms proposed to improve the task scheduling problem and its optimisation metrics. The simulations results demonstrate that the proposed algorithms can minimise waiting time, reduce makespan, and increase resource utilisation. The proposed algorithms also consider load balancing while distributing cloudlets to available resources, an added advantage compared to PSO and FCFS algorithms. As a limitation, this work focused only on makespan, waiting time, resource utilisation and degree of imbalance metrics. Future works may integrate other optimisation methods and consider more quality metrics, such as the migration of tasks between queues, the VM migration concept, and energy consumption.