Machine Learning Approach to Select Optimal Task Scheduling Algorithm in Cloud

The flexibility provided by the cloud service provider at reduced cost popularized the cloud tremendously. The cloud service provider must schedule the incoming requests dynamically. In a cloud environment tasks must be scheduled such that proper resource utilization is achieved. Hence task scheduling plays a significant role in the functionality and performance of cloud computing systems. While there exist many approaches for boosting the task scheduling in the cloud, it is still an unresolved issue. In this proposed framework we attempt to optimize the usage of cloud computing resources by applying machine learning techniques. The new proposed framework dynamically selects the scheduling algorithm for the incoming request rather than arbitrary assigning a task to the scheduling algorithm. The scheduling algorithm is predicted dynamically using a neural network which is the best for the incoming request. The proposed framework considers scheduling parameters namely cost, throughput, makespan and degree of imbalance. The algorithms chosen for scheduling are 1) MET 2) MCT 3) Sufferage 4)Minmin 5) Min-mean 6) Min-var. The framework includes 4 neural networks to predict the best algorithm for each scheduling parameters considered for optimization. PCA algorithm is used for extracting relevant features from the input data set. The proposed framework shows the scope for the overall system performance by dynamically selecting precise scheduling algorithms for each incoming request from the user.


INTRODUCTION
With the rapid evolution of processing and storage technologies and the accomplishment of the internet, computing resources have become affordable, more robust and globally available than ever before. The different models of cloud computing architecture like a layered model of cloud computing, Business model which provides different services like 1)Infrastructure as a Service(IaaS) 2) Platform as a Service(PaaS) 3) Software as a Service(SaaS).The challenges also increase with the demand of emerging cloud services [1]. Efficient task scheduling to provide Quality Of Service (QOS) is a major issue.
The tasks in the cloud can be scheduled statically or dynamically. The traditional method of scheduling was time and space shared. First Come First Serve (FCFS) and Shortest Job First (SJF) scheduling methods developed later outperformed the traditional methods. Generalized priority algorithms developed in [3] performed better than SJF and FCFS .
Cloud computing is a popular service based technology in the business world nowadays. Cloud infrastructure provides users with a flexible network access for computing resources that are accessible on the internet and pay as you use. In a typical cloud environment, a scheduling algorithm is chosen beforehand and the same algorithm is used for every request made. The chosen algorithm might not be the optimal one for every request made. This leads to a game of chance, wherein for some user requests the chosen algorithm may be the best algorithm and other times there may be other algorithms which could have outperformed the default algorithm. Each algorithm considers a single objective or it may consider multiple scheduling criteria [2] depending on the scheduling algorithm. The main issue here is that the algorithm is chosen beforehand and never changed. All these algorithms are developed with Research Article Vol.12 No.6 (2021), 2565-2580 different assumptions. Hence picking the suitable algorithm for solving a task assignment issue or certain nature becomes problematic. Here heuristic task scheduling algorithms based on six rules is considered. Machine learning technique for the incoming task requests to classify the best algorithm out of the six algorithms considered here for that request. The cloud environment is simulated where the scheduling best scheduling algorithm is dynamically chosen for every incoming request, which determines the best scheduling algorithm for each request on the go.
The machine learning techniques are applied in various areas including health care services and they increase the performance of health care services [4]. It maximized the cloud resource utilization by selecting appropriate VM. Machine learning has greatly performed in applications in the cloud. The new proposed model in this paper is an attempt to improve the system performance by dynamically selecting appropriate task scheduling algorithms by applying machine learning techniques. Here the Principal component analysis (PCA)is carried out to identify the suitable parameters for study. Multiple feed forward neural networks are designed for optimizing task scheduling parameters to predict the correct algorithm for scheduling the incoming request. Then the request is passed on to the corresponding Virtual Machine (VM) where the predicted scheduling algorithm is implemented. The proposed framework allows to achieve best accuracy in predicting optimization algorithms for the scheduling parameters, viz., degree of Imbalance, cost, makespan, throughput. The proposed framework contributes to the overall efficiency of the system performance through 1) dynamic selection of scheduling algorithms considering suitable workloads 2)Parameter optimization 3)PCA based feature selection.

RELATED WORK
The related work focuses on different algorithms and techniques used for task scheduling in cloud. It also includes different machine learning techniques used to address scheduling concerns in the cloud. The performance contrast of task scheduling in an Infrastructure as a service (IaaS) cloud computing environment is done using six rule based heuristic algorithms [21]. The algorithms are implemented for homogeneous as well as heterogeneous environments by considering several parameters like throughput, degree of imbalance, cost and makespan. The results show that these six-rule based heuristic algorithms give the optimal solutions for the IaaS cloud environment. The framework designed helps the cloud users to choose the best algorithm for the performance metric they want to optimize.
To optimize the resource allocation by using priority-based task scheduling and allocating the tasks to the conflict free resources was proposed [5]. This has a better makespan and improves the throughput of the system. This improves the overall performance of the cloud environment.
The comparative study of most used task scheduling algorithms in cloud environments is carried out [6]. This study will help to select the parameters for scheduling. The heuristic techniques are the most efficient for scheduling tasks in a cloud environment as compared to other scheduling algorithms.
The heuristic approach proposed in [7] provides better Turnaround time and response time when contrasted with existing bandwidth aware divisible scheduling (BATS) and improved differential evolution algorithm (IDEA) frameworks. The tasks for the system are real Cybershake and Epigenomics scientific workflows. The cloud provider will be benefited if resources are efficiently used.
In [8] analysis of different heuristic and energy efficient scheduling algorithms for cloud is considered based on the different number of parameters taken for scheduling. The study suggests that the parameters considered for designing new scheduling algorithms can be increased in number so that it can be favourable to cloud providers also.
The survey of various heuristic scheduling algorithms for task scheduling is accomplished here [9]. The survey suggests the improvements for the emerging scheduling requirements, which include multidimensional, multi objective and dynamic scheduling.
An attempt to address scheduling problems in the cloud using a heuristic approach is accomplished in [10]. The goal was to impart uniform response time to requests(tasks). The approach used is to decrease the variance of response time by decreasing the variance of access time.

Research Article
Vol. 12 No.6 (2021), 2565-2580 A venture to classify tasks in cloud environments using machine learning techniques is dealt in [11]. The idea behind the work proposed here is to optimize task scheduling by identifying the priority of each task and place them accordingly in different queues for further processing. To label tasks based on priority supervised machine learning techniques are used. The parameters used for comparison are accuracy, training time and speed of prediction.
The Deep Reinforcement Learning techniques are proposed for scheduling resources in an offline cloud environment [12]. DeepRM, DeepRM2 are modified to address scheduling problems of resources because basically they deal only with parameters relevant to CPU and Memory. The algorithms used here for scheduling are the shortest job first (SJF), Longest job first (LJF), Tetries and Random Algorithms. The study motivates that Deep Reinforcement Learning techniques can be used for similar optimization problems.
A framework to schedule tasks using machine learning techniques was proposed in [13]. The proposed system suggests that the best scheduling algorithm can be selected dynamically using supervised technique.
The review of task scheduling in cloud [14] lists the merits and demerits of each algorithm. The study helps the researcher to identify the parameters of scheduling in the cloud which needs more focus. The survey discloses that features such as optimization of cost and total execution time have already been covered. More focus is required towards methods for handling errors, providing reliable services and availability of services. Cloud services can be improved by implementing algorithms which consider more parameters.
Machine learning framework is applied in the field of aerospace applications [15]. The ML algorithms used are Mahout ML Library. The framework reduced the total life cycle cost by recognizing onset part failures, identifying irregularity and condition-based maintenance.
Traditional ML libraries do not support efficient large dataset [16]. To support parallel processing, ML is built upon as a SaaS. BigML, Bit Yota, Precog and Google prediction API are some of them.
In real time the QOS for resource allocation is difficult to achieve. The evaluated data for the current situation is compared with the historical data. Then, the optimal or near-optimal solution in the identical historical scenario is adopted to allocate the radio resources for the current scenario. Here a new design method is applied to allocate radio resources by using supervised machine learning techniques. [17].
A Survey of Machine Learning Applications to Cloud Computing [18] is discussed here. The article lists how ML applications can be used to improve dynamic resource management and prediction of VM size required. Artificial neural networks (ANN) and support vector machine (SVM) methods are used and it is situation dependent, which focuses on efficient resource usage and saves energy.
To optimize the performance of cloud scheduling inspired by Swarm Intelligence is proposed in [19]. Multiple criteria are considered here. The machine learning classifier chain algorithm identifies future algorithms to be used to schedule the tasks in every data center while having the best task execution time. The results improve significant performance of load balancing while scheduling.
The proposed technique in [20] for resource allocation with multidimensional requirements by using machine learning techniques. ML automatically understands both workload and system environments which help for intelligent resource allocation in cloud computing.
The proposed framework stands out in the literature from the following features: State of the artwork has focused on applying machine learning techniques for applications on cloud computing but the proposed framework is an attempt to improve the performance from the system end. We can apply machine learning to any existing scheduling algorithms to perform better. The scheduler acts intelligently by selecting appropriate scheduling algorithms. The scheduling can select any number of parameters including multi objective parameters. Even though in literature many algorithms are proposed to schedule tasks in cloud computing, machine learning is not used for scheduling prediction.

THE PROPOSED FRAMEWORK
The proposed framework is a new method of dynamically predicting the task scheduling algorithm for each incoming request. The architecture for the proposed framework is given in Fig.1. The requests are generated through the graphical user interface (GUI). The user requests IaaS from the Cloud service provider (CSP). The task is passed on to CSP, in turn to the task scheduler. The task scheduler selects the parameter to be optimized through the GUI provided. With the use of 4 neural networks the best scheduling algorithm is identified for the task. The task is allocated to the data centre where the corresponding VM is assigned. Each VM implements a different scheduling algorithm for the task and the task completes its execution.

IMPLEMENTATION
The implementation details include properties of simulating environment, data set generation and prediction method.

Simulation Parameters
The simulation was done using the CloudSim tool [22]. The dataset was generated in an environment having the following properties. This section explains the simulation setup.

Data set generation
The data set is generated using a CloudSim simulator. To simulate data a function was created which generates a set of tasks of random length between 50000-80000 mips and the number of tasks in the set is between 500-750. This set is passed to all the 6 scheduling algorithms and the details such as makespan, throughput, cost, degree of imbalance are obtained. Now all the features like number of tasks, Number of machines, Total length, Average load, Average arrival time difference are calculated, and the corresponding selected algorithm is appended. This makes up a single record. This function is iterated over 5000 times to produce a dataset for one performance metric and is stored in a .csv file. Then this entire process is repeated for the other three performance metrics which brings the total number of records to 20000.
The dataset consists of the following features: • Number of tasks -the number of tasks to be scheduled. • Number of machines -the number of machines on which the task has to be scheduled. • Total length -sum of length of all the tasks. • Average load -average load the selected machines. • Average arrival time differencesum of difference in arrival time between a task and the next task divided by the total number of tasks.
There are 4 datasets, one for each parameter considered (make span, throughput, cost, degree of imbalance). The data set in total contains 20000 records.

Prediction Methods
There are several methods available for the purpose of making predictions for the used data set. In this case it uses a neural network to predict the best scheduling algorithm for each metric i.e. cost, make span, throughput, degree of imbalance. Therefore, we have designed 4feed forward neural networks in which each of them predicts the best scheduling algorithm for each performance metric. The scheduling algorithms that are used here are: Minimum Execution Time (MET), Minimum Completion Time (MCT), Sufferage, Min-min, Min-mean, Min-var.

Performance Metrics Used
To compare the algorithms with each for a given task we have chosen 4 metrics [21]. 1)Makespan: It estimates the maximum completion time, by computing the finishing time of the current task. It is characterized as the amount of time, from start to finish for completing a set of jobs. A good scheduling algorithm always tries to reduce the makespan. It is one of the most commonly used criteria for measuring scheduling efficiency in cloud computing.
Where, Fnsh time represents the finish time of the i th task.
2) Throughput: In a cloud environment, throughput means some tasks are accomplished in a convinced time period. Throughput is the amount of work completed in a unit of time. It can also be described as the total number of cloudlets or tasks that are executed successfully within a given time period in cloud computing.
Where max task indicates Maximum Execution time, Min task indicates Minimum Execution time, Avg taski indicates Average Execution time of task among all VMs.

4)Cost:
The cost that each client pays for the time used by the VM. It is an amount that has to be paid against the usage of resources in cloud computing. Cost means the total payment generated against the utilization or usage of resources, which is paid to the cloud providers by the cloud users .It is profit and revenue for the cloud providers and expense for the cloud users besides the utilization of resources in cloud computing. Assume the cost of a VM varies from one another based-on time substantiality and the VM"s specification as specified by the cloud providers, then the following equation holds for the cost of Task Execution of a VM.
where C i represents the cost of resource i per unit time, and T i represents the time of utilization of resource.

Algorithms Used
It is observed that a number of task ordering methods have been developed and improved over a course of time. These methods can be categorized to either belong to exact or heuristic or meta-heuristic methods. In cloud computing, heuristic algorithms are designed to resolve the problematic issues faster than meta-heuristic algorithms, when their performance is too slow. The solutions obtained by the heuristic methods are optimum or near optimum in nature by using a smaller number of computer resources and computational time. In the proposed framework we have implemented the heuristic algorithms and pseudocode as referred from [21]. their dimensionality in an interpretable way, such that most of the information in the data is preserved. PCA is one of the most used methods to decrease dimensionality. Also, PCA is used to discover important features of a large data set. It reveals relationships between variables which help us decide whether the variable actually has any effect on the prediction process or not. The Principle component analysis (PCA) of the proposed framework is given in Fig.2, where the above mentioned five dimensions are mapped to a 2D grid.

Neural network architecture
For each neural network the sample dataset was split into train and test sets where the split ratio was set to 0.1. Since there are five input features (Number of tasks, Number of machines, Total length, Average load, Average arrival time difference) the input layer has 5 neurons where each neuron is for each input feature, followed by 3 hidden layers where each hidden layer has 6 neurons and an output layer with 6 outcomes. The Activation functions used in the hidden layers are "ReLU" and the activation function used for the output layer is "softmax". The loss function used is "categorical cross-entropy" and the optimizer function is "adam". The training process was performed for 5000 epochs and a batch size of 1000.The graphs shown in Fig.3 are the loss vs epoch graph for all the neural networks. The graphs clearly show how the loss of the model has dropped with every epoch. It also gives an idea as to when to take a decision to stop the training process. Looking at the final loss value it also gives a picture on how well the model has been trained.

User Interface for the proposed framework
The requests from the user for IaaS must be generated. The User Interface is designed to mimic the activities of the client. The snapshot of the same is given in Fig.4. . UI design for the implemented system Fig.4 depicts the instance of UI design where the user wants to optimize the makespan. The client enters the number of tasks that they want to submit and enters the number of VM. Now the application generates a specified number of tasks. The UI is created to mimic the activities of the clients in the real-world scenario. But here the application generates the tasks for simplicity. Then the client has the option of selecting the parameter that they want to optimize. Once the details are given and the Predict button is pressed the application calculates the features required i.e. number of tasks, Number of machines, Total length, Average load, Average arrival time difference.

Prediction process
As mentioned earlier a neural network is built using Python the Java application must send the features calculated to a Python file which performs the prediction. In order to achieve this the application creates a Python child process in which the prediction module in python is executed. All the calculated features are sent as arguments to the child process. The child process now has all the features required and can predict the outcome based on the received features. This prediction result is sent back to the parent Java application and shown to the user. As shown in the UI

Research Article
Vol. 12 No.6 (2021), 2565-2580 the user has the choice to select the parameter, they want to optimize so based on the user"s choice these features are given to that particular neural network(NN) model as input and the NN model returns the best scheduling algorithm for that particular input set and then the submitted set of tasks can be scheduled using the algorithm returned by the neural network.

0 RESULTS
Results about data set generation, overall evaluation of neural network, prediction outcomes, comparative analysis of scheduling algorithms are presented.

Data set generation sample
The data set was generated using different algorithms on the same set of tasks. Here we have considered 3 arbitrary sets of tasks and collected the results from all the six scheduling algorithms so that one can clearly see the changes in the values of performance metrics depending upon the algorithm used for scheduling.  Table 1,2,3 are the sample data set generated using CloudSim using randomly generated properties of the tasks. They are given as input to different scheduling algorithms. Here we have considered six scheduling algorithms. The output is the different set of values for makespan, cost, throughput and DI.

Results related to Confusion matrix of Neural networks
The different feed forward neural networks are evaluated based on the confusion matrix method. The metrics are indicated as below. Precision F1 score: F1 Score shows the balance between Precision and Recall.
F1 score = 2*((Precision* Recall)/ (Precision +Recall)) Based on the values confusion matrix generated, the performance measures are calculated and a summarized table for each optimization metric is given in table 4. Here only the performance measure of the best scheduling algorithm considered is given.

Prediction vs actual value:
In this section we see the performance of the actual application. Here we assign the same set of tasks to all the six scheduling algorithms and obtain their results. The same set of tasks is sent to the application which returns its prediction and then these values are compared for verifying if the algorithm that was predicted by the model is in fact the best scheduling algorithm.  Table 5 gives the details of 10 sets of tasks used for the evaluation.
Evaluation of actual performance in makespan optimization is shown in table 6. The first six columns contain the makespan values when scheduled using the corresponding algorithms. This gives a comparison of the actual algorithm to the predicted algorithm.   Evaluation of actual performance in Degree of optimization is shown in table 9. The first six columns contain the degree of imbalance value when scheduled using the corresponding algorithms.  Table 6,7,8,9 present an analysis of actual to predicted algorithms for optimizing makespan, throughput, cost, degree of imbalance in the view of task scheduling dynamically in the simulated cloud environment. Comparing the results

Research Article
Vol. 12 No.6 (2021), 2565-2580 of actual to predicted value in each optimization metric the accuracy is fairly matching with the results in the reference [21]. The dynamic selection of task scheduling algorithm using neural network based prediction approach is a novel contribution of this work. It is evident that machine learning techniques to dynamic selection of algorithm improves the overall system performance and adaptability.

Conclusion
The aim of the proposed framework is to design a new approach to dynamically schedule tasks in an IaaS cloud environment. In contrast to the previous works, this approach uses machine learning techniques to predict dynamically the scheduling algorithm for the incoming request. For a given set of tasks, the best algorithm is predicted for each of the following four parameters viz., cost, degree of imbalance, makespan and throughput. Task scheduler unit outputs the best scheduling algorithm to be used based on the parameter to be optimized. For the algorithms considered here by looking at the dataset, the neural network predicts that in terms of Degree of Independence Min-Var seems to be the best algorithm in most of the cases; for makespan, MET seems to be the best algorithm in most of the cases. while for throughput and cost there are no such visible patterns. Since task scheduling in a distributed computing environment is considered as a np-hard problem, we hereby propose a framework for solving this problem. PCA is used to capture the relevant features and make a machine learning model that can predict the best task scheduling algorithm for each set of tasks. In contrast to the previous works, integrating machine learning to determine the scheduling scheme helps improve the QOS and also save energy and resources that are valuable and most importantly computation costs, which in turn improves cloud accessibility to a wider demographic.