1 Introduction

Computational cloud is an emerged technology based on transferring the computation process from local desktops to remote providers on the Internet. Cloud computing services are extensive and have on-demand access to a pool of computational resources [1,2,3]. The consistency and stability of cloud services are based on several features such as the scheduling process of jobs. Cloud job scheduling is categorized into three levels: the job level, the resource level and the workflow level [4, 5]. In cloud job scheduling, users send jobs to cloud providers. Job scheduling distributes the jobs submitted by the clients to the provider suitable resources [6,7,8]. As illustrated in Fig. 1, in the cloud jobs scheduling, the users send their jobs to the central scheduler or broker. The job scheduler in the provider requests the resource information service for obtaining the state of suitable resources and their features and then assigns the jobs on suitable resources based on the job and resource information requirements. Cloud job scheduler allocates several users’ jobs to multiple cloud resources. Job scheduling mechanisms try to allocate cloud resources to users’ jobs in an optimal way [3, 9,10,11,12]. Cloud resources execute the submitted jobs, and the output is sent back to cloud users [4, 13,14,15].

Fig. 1
figure 1

Cloud job scheduling

The cloud jobs scheduling is a challenging issue due to the huge amount of tasks submitted by cloud users to cloud providers. Different types of cloud job scheduling have been proposed based on heuristic, metaheuristic and optimization techniques. Heuristics cloud job scheduling presents an optimal solution based on knowledge theories for obtaining optimal scheduling solutions. Optimization is the selection of the best solution based on some features from the solutions’ search space. Simply, optimization methods for cloud jobs scheduling try to minimize the jobs’ execution times by systematically mapping jobs to resources based on the optimization algorithm procedures. Metaheuristics methods are general methods used for job scheduling based on nature-inspired optimization methods such as particle swarm optimization and ant colony optimization. Although optimization techniques provide a good solution but still not an optimal solution, there is a need for new job scheduling methods to optimize the cloud execution times.

This study introduced an optimized metaheuristic job scheduling method using chemical reaction optimization (CRO). Chemical reaction optimization is a new metaheuristic algorithm inspired from the interactions of molecules to achieve the lowest energy state possible during a chemical reaction. CRO mimics molecules’ structure changes in chemical reaction microscopically. In chemistry, a molecule is made up of atoms. Atoms have different features. CRO summarizes all these characteristics under the term “molecular structure” which corresponds to a single solution. Furthermore, each molecule holds two sorts of energies: The first one is the potential energy (PE), and the second one is the kinetic energy (KE). PE corresponds to solution fitness value in terms of energy which is the objective function value.

This paper is organized as follows. Section 2 describes the related works. Section 3 illustrates how chemical reaction optimization works. Section 4 demonstrates the CRO mechanisms, and Sect. 5 describes the experimentations and discussions. We concluded in Sect. 6.

2 Related works

The research by Esa and Yousif [16] proposed glowworm swarm optimization (GSO) to handle the cloud job scheduling problem and distribution of the cloud tasks on available resources based on glowworm swarm optimization mechanism [16, 17]. The GSO mechanism considers each glowworm as a job scheduling solution. The mechanism starts with an initial random population contains a number of solutions. After developing the initial random population, GSO calculates the fitness value for each glowworm. The calculation of the fitness value starts by computing the local execution times of each resource for jobs assigned to that resource. Then, GSO finds the global execution time for each local execution time for each glowworm and finds the maximum fitness value [16]. In the research by Shohdy et al. [5], the proposed cat swarm optimization (CSO) handles the cloud job scheduling problem and distribution of the cloud tasks on available resources. Each cat represents a candidate solution. The cat’s population is divided into two modes, seeking mode (SM) and tracing mode (TM).

Esa and Yousif [18] proposed a firefly algorithm metaheuristics job scheduling to optimize the fitness of cloud scheduling solutions. Firefly algorithm is a nature-inspired metaheuristics based on the light attractiveness of fireflies [19, 20]. The mapping process considers each firefly as a job scheduling solution. The firefly that has less brightness is attracted and moved toward the brighter one [10, 21]. This process continues for several iterations until the algorithm reaches a specified fitness value [18].

The researchers in Wang et al. [22] emphasize the efficiency in multiple clouds using meta-scheduling model to accomplish an enhanced job scheduling in multiple clouds. The study proposed a new inter-cloud task scheduling method and employed protocols and rules to improve the efficiency of clouds [22].

Jana et al. [4] presented a modified particle swarm optimization (MPSO) method that has two important factors in scheduling average times and percentage of successful solutions.

3 Chemical reaction optimization (CRO)

Chemical reaction optimization firstly proposed as a new metaheuristic algorithm inspired from the interactions of molecules to achieve the lowest energy state possible during a reaction. CRO mimics what happens to molecules in chemical reaction microscopically. Each reacting system tries to find a minimum of free energy, and hence all chemical reactions try to release energy. Lower energy tends to give more stable molecule [23, 24].

In chemistry, a molecule is made up of atoms. Atoms have different features. CRO summarizes all these characteristics under the term “molecular structure” which corresponds to a single solution. Furthermore, each molecule holds two sorts of energies: The first one is the potential energy (PE), and the second one is the kinetic energy (KE). PE corresponds to solution fitness value in terms of energy which is the objective function value. KE quantifies the forgiveness of tolerating a less stable structure. CRO also employs the conservation of energy law which states that “energy can neither be created nor be destroyed.” However, energy is transmitted between molecules or within a molecule. A central buffer is also used to sustain KE of the molecules. Therefore, the molecules tend to have less KE as the algorithm progresses [24, 25].

When molecules collide with each other or with the wall of the container, each collision results in one of the four elementary reactions which are: on-wall ineffective collision, inter-molecular ineffective collision, decomposition and synthesis. These four reactions can be categorized based on two different aspects. Based on the extent of change to the molecular structure, on-wall ineffective collision and inter-molecular ineffective collision result in a small amount of change to the structure of the reacting molecules [22, 26]. Conversely, decomposition and synthesis result in different molecules with a new molecular structure. Based on molecularity, on-wall ineffective collision and decomposition are uni-molecular, while inter-molecular ineffective collision and synthesis involve more than one molecule [22, 24].

The basic idea of CRO tries to explore an intelligent way of different regions of the potential energy surface PES. In CRO, exploitation of the surrounding area in PES is carried out by on-wall ineffective collision and inter-molecular ineffective collision. However, when the algorithm failed to converge to the lowest energy molecule or entrapped in local optima, an exploration is performed through decomposition and synthesis.

CRO algorithm includes three stages: initialization, iteration and the final stage. In the initialization stage, a number of variables and control parameters need to be defined and initialized. Note that CRO is a population-based metaheuristic and its population size varies during algorithm iterations due to the behavior of decomposition and synthesis. In the iteration stage, a series of collisions occurred. However, in order to perform a collision, the algorithm first needs to decide whether the collision involves one molecule or more than one. After that, the algorithm examines the decomposition criterion in the case of uni-molecular collision and synthesis criterion in the case of inter-molecular collision. Decomposition is performed if its criterion is satisfied; otherwise, an on-wall ineffective collision is performed. Similarly, the algorithm performs synthesis or otherwise an inter-molecular ineffective collision if it failed to achieve the synthesis criterion. The iteration criteria keep on the repetition process causing molecules to collide until eventually a stopping criterion is satisfied, and the algorithm enters its final stage where it outputs the solution with the lowest energy [26].

4 The proposed CRO-based scheduling mechanism

The following subsections describe the proposed CRO mechanism for job scheduling in cloud computing.

4.1 The proposed CRO mechanism description

The proposed CRO initializes a population of \(M\) molecules. Each molecule has a number of properties, i.e., molecular structure and potential energy. In the proposed mechanism, \(M\) represents the molecular structure of each molecule as a vector of integer values, each of which represents a feasible solution. The potential energy (\({\text{PE}}\)) of each molecule represents its fitness in the objective function. Moreover, each molecule has a kinetic energy (\({\text{KE}}\)), which plays a role of a forgiveness threshold that forgives CRO when it accepts a molecule with a higher potential energy. Imagine that a number of molecules exist in a closed container. These molecules travel and collide either on the walls of the container or with other molecules. Four forms of elementary reactions are produced by the collision.

The four elementary reactions that take place between molecules are described in the following subsections.

  1. i.

    On-wall ineffective collision

In this elementary reaction, a molecule \(M\) hits the wall of the container and this causes small changes to the molecular structure of the molecule. Thus, we get a new molecule \(M^{\prime }\) from an existing \(M\) by swapping two values of \(M\) molecular structure (vector) randomly.

  1. ii.

    Inter-molecular ineffective collision

In this reaction, two molecules \(M_{1} ,M_{2}\) hit each other, causing small changes in both of them. And we get two new molecules \(M_{{1^{\prime } }} ,M_{{2^{\prime } }}\) from the existing molecules \(M_{1} ,M_{2}\) by swapping two values from the molecular structure of each molecule \(M_{1} ,M_{2}\) randomly.

  1. iii.

    Decomposition

In decomposition, a molecule \(M\) hits the wall which results in a significant change to the molecular structure. Thus, the molecule decomposes into two new molecules \(M_{{1^{\prime } }} ,M_{{2^{\prime } }}\). The molecular structure of \(M_{{1^{\prime } }}\) is formed of the left half of the original molecule \(M\) and random values, while \(M_{{2^{\prime } }}\) is formed of the right half of the original molecule and random values.

  1. iv.

    Synthesis

In synthesis, two molecules \(M_{1} ,M_{2}\) collide with each other and form a new molecule \(M^{\prime }\). We get \(M^{\prime }\) by combining the left half of \(M_{1}\) with the right half of \(M_{2}\).

4.2 CRO for cloud job scheduling pseudocode

figure a

4.3 The proposed CRO for cloud job scheduling description

This section describes the proposed CRO for cloud job scheduling process, mapping and equations.

Assume we have a set of \(n\) jobs that need to be scheduled among a set of \(m\) resources where \(n > m\)

$$N = \left[ {J_{1} ,J_{2} ,J_{3} ,J_{4} , \ldots ,J_{n} } \right]\quad M = \left[ {R_{1} ,R_{2} ,R_{3} ,R_{4} , \ldots ,R_{m} } \right].$$

Let \(n = 5 jobs\) as given in Table 1 and \(m = 4\;{\text{resources}}\) as given in Table 2.

Table 1 Example jobs
Table 2 Example resources

CRO steps to find the optimal scheduling problem

figure b
figure c
figure d
figure e

5 Evaluation and experimentation

This section describes the experiments carried out to assess the proposed chemical reaction optimization mechanism. The first part of the section illustrates the parameter configuration employed for the simulation including the servers utilized to execute the simulation and the cloud infrastructure. The second part describes the benchmark and the parameters for the proposed chemical reaction optimization.

5.1 Experimental settings and system configurations

To carry out the experiments, the study applied a prototype of the proposed chemical reaction scheduling mechanism using CloudSim simulator. The CloudSim software was installed in a DELL server with Intel i7-2760QM CPU 2.70 GHz with 8 cores and memory size of 8 GBs. The evaluation process employed several benchmarking software programs with the Java programming model. The experiments extracted the execution time that represents the evaluation process output. The cloud computing model designed for the experiments is a private cloud hosted by a cloud provider involving two forms of computing servers, AMD and Intel. The details of these servers are described in Table 3.

Table 3 Cloud infrastructure configurations

5.2 CRO parameters settings

The evaluation process and CloudSim simulation setup for chemical reaction optimization are configured according to the standard parameter setting for chemical-reaction-inspired metaheuristic for optimization [24], as described in Table 4.

Table 4 Chemical reaction optimization parameters

5.3 Simulation scenarios

To evaluate the proposed job scheduling mechanism, three scenarios are considered. The first scenario setup is a comparison between the CRO scheduling method with first come first served and random solution mechanism. The second scenario contains a comparison with the glowworm metaheuristic algorithm using two experiments. In the last section, this study compared the proposed method with the GSO algorithm and the CSO algorithm.

The proposed mechanism is simulated using the CloudSim simulation model. The population size of CRO is set to 30 instances, and the maximum number of iterations to 100 iterations. Each scenario is conducted 10 times, and the results are reported. The processing powers of resources are generated randomly between 10 and 70, while the lengths of tasks are between 40 and 150 million lines.

5.3.1 CRO, FCFS and random solution experiment scenarios

The first experiment conducts a comparison of execution times between CRO and first come first served (FCFS) algorithm. The experiment employed the same jobs and resources for the two mechanisms.

As illustrated in Table 5 and shown in Fig. 2, the proposed CRO obtained shorter execution time than that of FCFS. Random distribution of tasks on resources performed better than the FCFS algorithm. CRO has the best execution times in all scenarios.

Table 5 Comparison between CRO and FCFS algorithm
Fig. 2
figure 2

Comparison results in the last scenario

Table 5 and Fig. 2 results revealed that the proposed CRO mechanism for cloud job scheduling efficiently optimizes scheduling solutions’ fitness values. As it can be seen in all scenarios, the execution time decreases as the iterations increase. As shown in Fig. 2, the proposed algorithm has a shorter execution time than that of FCFS and the difference in execution time between CRO and FCFS increases significantly as the number of jobs increases. Therefore, the proposed mechanism is more efficient to work in heavy-load systems than in lightweight systems.

5.3.2 Comparison between CRO and GSO

This section compares the proposed CRO method with the GSO algorithm using two scenarios.

  1. (i)

    First scenario

In the first scenario, the researchers conducted an experiment with a number of 50 jobs and 20 resources.

As illustrated in Table 6 and shown Fig. 3, CRO starts with a better solution than GSO. In the first few iterations, GSO found better solutions than CRO and continued to improve the solution until iteration 200 when it remained constant and did only a minor improvement. CRO continued to improve its solutions and found better solutions than GSO after 700 iterations and sharply improved its solutions until it ends with a fitness of 83 in the last iteration.

Table 6 Execution time in the first scenario
Fig. 3
figure 3

Comparison results in the first scenario

  1. (ii)

    Second scenario

As shown in Table 7 and Fig. 4, CRO starts with a better solution than GSO and continued to improve the solution in the first 200 iterations. GSO started with a longer solution than CRO; however, it quickly found a better solution in the first few iterations and remained better until iteration 300. CRO found a better solution after 300 iterations and continued to improve the fitness by reducing the execution time.

Table 7 Execution time in the second scenario
Fig. 4
figure 4

Comparison results in the first scenario

5.3.3 Comparison between CRO, GSO and CSO

This section presents a comparison between CRO, GSO and CSO.

As shown in Fig. 5, CSO has the shortest execution time compared to CRO and GSO when the experiment started. CRO started with a solution better than GSO and then GSO progressed to find shorter solutions than CRO. Yet again, CRO found a better solution than GSO in iteration number 275; nonetheless, it was not better than CSO. CRO continued to improve its solutions until it reached the shortest solution compared to CSO and GSO after 400 iterations.

Fig. 5
figure 5

Comparison results between CRO, GSO and CSO

5.4 Discussion and technical contributions

The different scenarios of the simulation and analysis proved that the proposed CRO for cloud job scheduling has better execution times than those of cat swarm optimization and first come first served mechanisms. Furthermore, the proposed CRO mechanism is compared with glowworm swarm optimization mechanism and the results revealed the superiority of the proposed CRO over GSO mechanism. The results of simulation of the proposed chemical reaction optimization for cloud job scheduling revealed that the proposed mechanism optimized the cloud jobs’ execution times. The reduction in cloud job execution times of the CRO compared to first come first served and cat swarm optimization enhances the efficiency of the cloud system. The expected enhancement of the efficiency of cloud system allows cloud providers to finish user’s jobs in a shorter time. Therefore, the proposed CRO mechanism can be integrated with cloud emerging technologies to enhance the performance of cloud computing.

6 Conclusion

This paper proposed a chemical reaction optimization mechanism for cloud jobs scheduling. The proposed mechanism started by initializing a number of molecules that have the same size as the initial scheduling solutions’ population size. The structure of molecules is a one-dimensional vector with random values that represents the scheduling solution structure. The execution time is estimated according to the objective function, and the resulting values are the PE of molecules. The initial KE of every molecule is initialized to the value of InitialKE. In each iteration, the study decides whether a uni-molecular or an inter-molecular reaction is applied in the phase according to a comparison result of a random number h [0, 1] with MoleColl. The research determines a suitable subset of molecules to undergo an elementary reaction determined by whether the elementary reaction is uni-molecular or inter-molecular. The iterations continue till a certain condition is fulfilled. Simulation analysis is conducted to evaluate the proposed CRO mechanism. The results revealed that the proposed CRO mechanism has achieved the shortest execution time in the final phase of each scenario. The study compared the proposed mechanism with two metaheuristic algorithms such as GSO and CSO. The experimentation results found out that the proposed CRO outperformed both GSO and CSO in different experiment scenarios. Furthermore, the experiment results evidenced that the performance of the proposed CRO is increased when the workload and the number of iterations increase.