Adaptive Workflow Scheduling to Increase Fault Tolerance in Cloud Computing

: Cloud computing in the field of high-performance distributed computing has emerged as a new development in which the demand for access to resources via the Internet is presented in distributed servers that dynamically scale are acceptable. One of the important research issues that must be considered to achieve efficient performance is fault tolerance. Fault tolerance is a way to find faults and failures in a system. Predicting and reducing errors play an important role in increasing the performance and popularity of cloud computing. In this study, an adaptive workflow scheduling approach is presented to increase fault tolerance in cloud computing. The present approach calculates the probability of failure for each resource according to the execution time of tasks on the resources. In the present method, a deadline is set for each of the tasks. If the task is not completed within the specified time, the probability of failure in the source increases and subsequent tasks are not sent to the desired source. The simulation results of the proposed method show that the proposed idea can work well on workflows and improve service quality factors.


INTRODUCTION
The advent of cloud computing is considered to be the biggest change in information technology. This change has attracted the attention of everyone, from people in the community to large corporations. Today, the popularity of cloud computing is so widely accepted that organizations are moving their traditional information processing systems to cloud services to store large amounts of data [1], [2].
Cloud computing has emerged as a demand-based computing services model for use by small-scale users and large-scale scientific and commercial applications. This model is defined as a model for accessing a network with a shared set of configurable computing resources (e.g., networks, servers, storage space, applications, and services) that can be quickly and efficiently defined. Minimize managerial effort or service provider interaction, access to demand, resource independence, fast flexibility and always availability are the basic features of cloud computing [3], [4].
Due to the popularity of cloud computing among users and service providers, this environment has been very popular in the last decade. The presence of users and service providers from different places and with heterogeneous systems in this medium have caused many challenges. In cloud computing, fault tolerance is an important problem and resource failure time is one of the metrics that affect performance, throughput, response time and system and network performance [5].
Load balance fault tolerance is one of the main challenges in cloud computing that is required to distribute network load evenly across all nodes. This load is the amount of work that a computing system does, which can be classified as network load, storage capacity, memory capacity, and CPU load [6].
Error tolerance is a way to find faults and failures in a system. If an error occurs or there is a hardware failure or software defect, the system should also work properly. Malfunctions must be controlled in a dynamic way for reliable cloud computing. It will also provide availability and reliability against hardware and software failures of the system in the organization [7], [8].
Predicting and reducing errors has two types of techniques: active and passive. Active fault tolerance 26 policy, avoiding fault recovery by anticipating and actively replacing a suspicious component to detect it before a fault occurs. Passive fault tolerance reduces the impact of failures on executable programs when effective failures occur [9]. Therefore, in this study, an adaptive workflow scheduling approach is proposed to increase fault tolerance in cloud computing. The present approach calculates the probability of failure for each resource according to the execution time of tasks on the resources. In fact, in the present method, a time limit is set for each of the tasks. If the task is not completed within the specified time limit, the probability of failure in the source increases and the next tasks are not sent to the desired source.
In the proposed method, the input flow is timed through a resource management unit. At this stage, according to the characteristics of the resources, the tasks are assigned to the nearest source in terms of service quality factors to be executed. The scheduling plan is then provided to a task management unit to set a time limit for each task, as mentioned, according to the number of instructions for each task, and to review the time frame for performing previous tasks in the resources. Slowly If a resource task is running for more than the specified time, the probability of resource failure increases.
Thus, the task management unit calculates a failure probability for each resource. Based on the probability of failure, the tasks are then sent to the resources, which are virtual machines, to complete the continuation of the task execution process. The main innovation in the present study is the addition of a task management unit which, according to the number of instructions for each task and the characteristics of the resources, assigns an adaptive time limit to each task to be performed in each resource. Then, according to the history of performing tasks in the resources, the probability of failure for each resource is calculated.

LITERATURE REVIEW
Fault tolerance provides complete and permanent operation even when incomplete components are present. It is the continuation of work satisfactorily in the face of obstacles, art and science that creates the computational system. The fault tolerance system does not allow one or more types of errors to occur, including momentary, definitive or permanent hardware or software failures, design errors, operational errors, or damage caused by the program itself or physical damage. In a real-time cloud application, these operations are performed remotely in the computational node and the probability of error occurs [10]. These events emphasize the need for fault tolerance technology to achieve the reliability of real-time computing in the cloud infrastructure.
Abu Hamama et al. have proposed a comprehensive framework that incorporates a number of error tolerance methods to improve the reliability of cloud environments for hosting applications in real time, if reliability is achieved and access conditions are provided. Then the real-time fault tolerance scheduling algorithm is proposed to minimize the number of missing deadlines, and the amount of load imbalance [11].
Yan et al. presented the uncertainty model by estimating task execution time and a contrast-task assignment mechanism that strategically uses two errortolerant task scheduling models, while considering uncertainty. In addition, an overlap mechanism has been used to improve the use of cloud resources. Based on two mechanisms, a dynamic innovation-based scheduling and scheduling algorithm based on Dynamic Innovation (DEFT) is proposed for scheduling real-time tasks in the cloud in which system performance fluctuations must be considered. The purpose of DEFT is to achieve both fault tolerance and resource utilization [12].
Ding et al. presented a flexible common error scheduling algorithm for cloud workflow (FTESW). After analyzing the initial scheduling constraints, backup in cloud systems due to interdependence between tasks in the workflow is presented, a tensile mechanism in the field of fault tolerance is designed to dynamically adjust resources based on resource requests by adopting resource migration technology, FTESW is then proposed to achieve both fault tolerance and full resource utilization for workflow in cloud systems. To evaluate the effectiveness of the proposed FTESW, a series of simulation experiments were performed on both randomly generated workflows and real-world workflows [13].
Talvani et al. have effectively evaluated and processed barriers to gain robustness and reliability in cloud computing. Various error detection methods and architectural models have been proposed to increase cloud fault tolerance. Given this fact, this article focuses on solving the problem of error in cloud computing. This research, in order to identify the work that has been done in this field, shows the basic concept of fault tolerance that has been done by different researchers and different algorithms to solve the problem of fault tolerance in cloud computing [14].

METHODOLOGY
As mentioned, in this study, in order to present the error tolerance approach in cloud infrastructure, an approach of workflow distribution and adaptive scheduling based on task execution time in resources has been used, which will be described in detail in the following method.

Workflow
As cloud end users use host applications, the workload includes tasks that dynamically go to the central scheduler. Each task contains a set of tasks that is a set of = { 1 , 2 , … , } with tasks. Each of the tasks has a time limit or deadline to be performed, which in case of exceeding this deadline, the performance of the task and its related tasks will be adversely affected.
In this research, we use the non-distance directional graph (DAG) to show the workflow provided by the customer to cloud systems with software deadline. A = ( , ) contains tasks that are connected through control and data flow.
Where, represents the amount of data to be transferred from to , and represents the control relationship, such as the loop and the selected structure, between and . The size of each task is measured by millions of instructions that affect its execution time. We also use ( ) and ( ) to indicate the previous and next set of tasks of task , which means that ( ) must be completed before starting . An example of a workflow is shown in Fig.  1. For each task sent in the workflow, two versions are provided as and for the initial version and the backup, respectively. They run on different hosts for fault tolerance.
( ) and ( ) are used to represent virtual machines containing and , while ℎ( ) and ℎ( ) are hosts, respectively. The task execution time in the virtual machine is calculated as ( ) as the ratio of the task size to the processing power of the virtual machine. For example, ( ) = , ( ) = means that the initial version of is scheduled in the , virtual machine hosted on ℎ , and has an execution time of ( ) of . In addition, the time used to transfer can be stated as follows:

Fault Model
Tasks will fail and stop running when an error occurs in the processor unit in which they are located. In this study, we focus on host failure. A host fails when all the virtual machines in that host can no longer work and cannot complete the copies of the tasks in the virtual machines. Errors can be temporary or permanent, and it is assumed that the error is in one independent host and affects only one host. The maximum number of hosts that are expected to fail at any given time is assumed to be one. This means that if the original version of a task fails, the backup can always be completed before another host fails. For each task, backup is done after scheduling the initial version. However, it is not necessary to back up all tasks in a workflow after scheduling initial versions of all tasks in the same workflow. It is also assumed that the minimum value required for the average error time (MTTF) is always greater than or equal to the maximum execution time of a virtual machine from the same host.
There is an error detection mechanism such as an error signal and an acceptance test to detect errors. If an error is detected in an initial version, the backup will be executed and new tasks will not be sent to the host that received the error. If the completion of the initial version is successful, the resources will be restored by deleting the backup. Restoring resources is essential so that backup time can be allocated to new tasks.

Predict Fault
Predicting an error in a host can speed up the completion of tasks and prevent new tasks from being sent to hosts suspected of error. In this module, error prediction is based on the average time of error, which was introduced in the previous section. As mentioned, the minimum value required for the average error time is always greater than or equal to the maximum execution time of a virtual machine from the same host. Given that the virtual machines are heterogeneously distributed in one host, it can be said that the minimum value required for the average error time is always greater than or equal to the maximum execution time in the slowest virtual machine of the same host. By assigning a task to a virtual machine from a host, the average amount of error time is determined based on the number of instructions in each task and the processing power of the virtual machines in the host, based on Equation 3 for each task.
Subject to 11 ≤ 12 ≤ 13 , … ≤ ≥ 0 The scheduler includes a workflow analyzer, a prototype controller, a backup controller, a resource manager, a task manager, and an error forecasting module. When a workflow is entered, the scheduler determines whether it is first accepted in collaboration with the workflow analyst and resource manager. For the accepted workflow, the workflow analyst analyzes the relationship and prioritizes scheduling among tasks. A backup is then made by the backup controller. The faulttolerant scheduler is then connected by the main controller and the backup controller. If active resources fail to meet the schedule request, the resource manager switches some hosts from sleep to active to increase active resources. In addition, the host reports information about its status, including the status of scheduled tasks, the next access time to each active virtual machine for other tasks, and the resource usage of each active host, directly to the scheduler, and the resource manager and records the status of all hosts in cloud systems. If the initial version of a task is successful, the initial version success information is sent to the resource manager. The resource manager then notifies the virtual machine to which it has sent the backup of the assigned task to cancel the backup. Otherwise, the resource manager will not notify the virtual machine to cancel the backup, and scheduling backups will normally be performed for fault tolerance. In addition, if the host is in low workflow mode and some virtual machines remain idle for a long time, the resource manager decides that some virtual machines should be used to improve resource utilization and be deleted or transferred to other hosts. Since cloud systems resources are shared among all customers and workflows are dynamically sent to cloud systems at runtime, the above process for each stream something is repeated.
Each workflow is given to the task manager as a set of tasks, so that the task manager can create backups and backups of each task and provide their information to the resource manager for allocation to the machine and sends virtual error prediction modules to calculate the average error value. The initial version of each task is assigned to one of the virtual machines in the host, followed by the task manager backing up the task. The task backup is also sent by the resource manager to another active virtual machine on the other host. When the initial version of a task starts working in a virtual machine, time is allotted for that task. If the execution of the initial version of the task in the virtual machine is completed successfully by the time of the average error, the error forecasting module sends the command to cancel the execution of the backup to the task manager.
The Task Manager also records the success information of the original version on the target host and cancels the backup. The task manager also sends information about the success and cancellation of the backup to the resource manager to prevent the backup from running on another virtual machine on another host.
If the execution of the initial version of the task in the virtual machine is not completed successfully by the time of the average error, the error forecasting module sends the command to stop the execution of the initial version in the current virtual machine and transfer it to another virtual machine in the same host. Slowly The error prediction module waits until the time limit set for task i expires. If the execution of the initial version of the task in the current host virtual machines is completed by the end of the deadline for task i, the error prediction module sends the command to cancel the backup to the task manager. Otherwise, the error forecasting module sends a backup command to the task manager by imposing a penalty on the present host. Due to the penalty imposed on the current host, new tasks will not be transferred to this host and the current host, despite the fact that there may be active virtual machines in that host, in the queue of hosts that if they make a mistake, they will be placed. Assignment of tasks to these hosts is delayed until the completion of tasks related to the current workflow and the arrival of a new workflow.

RESULTS AND DISCUSSION
In order to implement the proposed method, according to the previous chapters, in this dissertation, 20 tasks have been used in the form of a workflow. In order to assign these tasks to run in the cloud, we used 5 hosts with 15 virtual machines. The method is simulated in MATLAB software version 2015. Tasks that reach the cloud environment are workflows in which tasks can communicate with each other. Therefore, due to the relationship between tasks, the discussion of data transfer and priority in execution occurs, which is one of the main discussions in the cloud environment in order to serve the tasks. As mentioned, the workflow includes a number of tasks in line with a specific goal, which, based on the priorities between the tasks, the order of execution of these tasks, has a decisive role in the implementation of the entire workflow. Fig. 2 shows an example of the workflow sent to the cloud environment.

Fig. 2. Workflow.
As shown in Fig. 2, the current workflow has 20 tasks, some of which are related to other tasks. The margins between tasks are directional, indicating the priority and lag of tasks in estimating the overall goal of the workflow.
Due to the fact that the proposed method aims to increase the fault tolerance in the cloud environment, it tries to optimize the main factors in the quality of service, so first prepare and maintain a copy of the received tasks as a backup. Tasks that reach the cloud are identified based on the number of instructions in each task, which is the instruction measurement scale of instructions, million instructions per second (MIPS). In addition, each resource has processing power that is released from service providers. Therefore, the task execution time in the virtual machine can be calculated as the ratio of the task size to the processing power of the virtual machine. In addition, the time used to transfer data while performing tasks between two virtual machines can be calculated using Equation 2. Therefore, Table 1 shows the specifications of the original and backup versions, the time required to perform the task and the time required to perform the previous task, if any, the time required to transfer data between virtual machines based on the amount of data. As shown in Table 1, the execution time of the related tasks is calculated according to the items in the workflow.

Implement Adaptive Fault Tolerance Scheduling
As mentioned in the previous chapter, in the proposed method, when a workflow is entered, it first approves or rejects the task acceptance scheduler according to the number of virtual machines and the connections between the tasks. After confirming the acceptance of the workflow, a backup of the tasks is prepared by the task controller. The scheduler sends each version to a virtual machine to run. If the initial version of a task is successful, the initial version success information is sent to the resource manager. The resource manager then notifies the virtual machine to which it has sent the backup of the assigned task to cancel the backup. Otherwise, the resource manager will not notify the virtual machine to cancel the backup, and scheduling backups will normally be performed for fault tolerance. Since cloud systems resources are shared among all customers and workflows are dynamically sent to cloud systems at runtime, the above process for each stream something is repeated. In the continuation of this chapter, according to the implementation of the proposed method, the main factors that affect the quality of service are calculated in order to evaluate the performance of the proposed idea.

Implementation of Fault Tolerance
In the proposed method as mentioned in the previous chapter, the proposed method of predicting an error in a host can expedite the completion of tasks and not send new tasks to hosts suspected of error. In this module, error prediction is based on the average time of error, which was introduced in the previous section. As mentioned, the minimum value required for the average error time is always greater than or equal to the maximum execution time of a virtual machine from the same host. Given that virtual machines are heterogeneously distributed across a host, it can be said that the minimum value required for the mean error time is always greater than or equal to the maximum execution time of the slowest virtual machine from the same host. In order to implement the error according to the optimization model specified in Equation 3, the fault tolerance rate and error prediction in cloud resources are shown in Table 2.
As shown in Fig. 3, the error tolerance rate increases at a slower rate due to the assignment of tasks and the use of backups.

Implement the Cost in the Proposed Method
According to the proposed method, the cost of completing tasks in resources consists of costs related to processing and costs related to the transfer of information in the network between resources while performing related tasks. Therefore, it can be noted that the processing cost for a given task depends on the task volume and the fixed cost (processor price per instruction). Also, in order to calculate the cost of data transfer in the cloud network between resources, the relationship between tasks can be used to calculate the volume of information sent in the network and the cost of this information. Table 3 shows the costs associated with completing tasks in each resource in the cloud environment.  Table 3, the cost of performing tasks in the resources to which the independent tasks are assigned is less than the resources in the dependent resources. Resources on which the cost of performing tasks is zero are resources to which no task has been submitted; these resources are the same resources that have been penalized by the proposed method and will not be assigned a task until the end of the workflow. Fig.  4 shows the cost-completion task chart in the resources. Also, in order to show the total costs in the resources to perform the tasks in the proposed method, the cumulative cost function is used, the diagram of the cumulative cost function is shown in Fig. 5. As shown in Fig. 5, the cost of completing tasks in all sources has increased slightly, and finally for 20 virtual machines in 4 hosts, this cost has reached 1.25.

Implement Energy in Cloud Resources
As mentioned in the previous chapter, due to the fact that virtual machines are heterogeneous in the proposed method, the energy required to perform tasks varies from source to source. Therefore, in each fixed source, energy consumption will be different from other sources. Fig. 6 shows the energy consumption diagram in the proposed method. As shown in Fig. 6, resources where independent tasks are loaded consume less energy, while energy consumption in resources with dependent tasks is higher.

Completion of Tasks in the Proposed Method
In order to implement the task execution time in the proposed method, the total task completion time in the cloud environment includes the task execution time and the transmission time in the network. Therefore, the time of completion of tasks in the cloud environment is directly related to independent and dependent tasks. In other words, resources that need to exchange information with other sources need more time to complete tasks. Naturally, there will be more delays in completing tasks in such resources. Fig. 7 shows the completion time chart in each resource. Fig. 8 also shows the delay diagram in the proposed method.  Also, in order to calculate the completion time of all tasks in all resources, the cumulative time function is used, which summarizes the time spent in each resource and shows it graphically during the completion of tasks in the resources. Fig. 9 shows the cumulative function diagram of task completion time across resources. As shown in Fig. 9, the task completion time, which increases due to the availability of resources with dependent tasks, eventually reaches 9.5 seconds for a 30task workflow at 20 sources in 4 hosts.

Comparing the Proposed Method with the Previous Work
In order to compare the proposed method with the previous method, in this section we compare the proposed method with other scheduling methods in the basic article. This comparison is first based on the criterion (HAT). This criterion indicates the number of active hosts when assigning tasks to virtual machines. Fig. 10 shows a comparison between the proposed method and the previous methods in terms of HAT criteria.  HAT(104s)

Workflow number
As shown in Fig. 10, the number of active hosts in the proposed method is less than the other methods in the basic article, and the amount of energy consumed will be less according to the proposed method.
Another criterion used in this dissertation for comparison is the criterion (CCR), which is the average cost of transferring tasks over the cost of performing tasks, which is compared in Fig. 11 between the proposed method and previous methods in terms of The CCR criterion. Fig. 11. Comparison of the proposed method with previous methods in terms of CCR criteria.
As shown in Fig. 11, the transfer cost per implementation of the proposed method is lower than other methods in the base article. Therefore, it can be said that the performance of the proposed method has been better in allocating tasks to resources and reducing the time and cost of completing the entire work and error tolerance.

CONCLUSION
In the cloud environment, computing resources need to be timed so that both providers get the most out of their resources and users get the applications they need at the least time and cost. On the other hand, given that the cloud environment is heterogeneous and needs and demands are changing at all times, a good decision to schedule the workflow in the cloud environment is complex and vital at the same time. Therefore, in this study, an adaptive workflow scheduling approach is proposed to increase fault tolerance in cloud computing. The present approach calculates the probability of failures for each resource according to the execution time of tasks on the resources. In fact, in the present method, a time limit is set for each of the tasks. If the task is not completed within the specified time limit, the probability of failure in the source increases and the next tasks are not sent to the desired source. The simulation results show that the proposed method, in addition to increasing error tolerance, also improves other factors affecting service quality.