1 Introduction

Cloud computing provides application access to all the users and businesses based on demand from any part of the world. Computing becomes a delivered service in the cloud computing to the users. Resources are abstracted and provided as services to the users based on their demand. Data centers are the major elements which are maintained by the cloud providers. Cloud service providers charge the consumers for accessing the resources over the network. Instead of investment cost towards the resources, enterprises receive the resources as services. So consumers are able to reduce their investment cost towards the resources. Service Level Agreements (SLAs) are established between consumers and service providers to mention the guarantees of service providers to the consumers [1].

Task scheduling distributes the user tasks on the resources with the aim of maximizing the utilization rate and minimizing the task execution time. Task scheduling can be classified into two types: static scheduling and dynamic scheduling. In static scheduling, task and resource details are known by the scheduler. In dynamic scheduling, task and resource details not known in advance. The Scheduler makes dynamic scheduling plans to distribute user tasks to the suitable resources.

Dynamic scheduling problem is a kind of NP-complete problem in which computation exponentially increases with respect to the problem size [2]. Meta-heuristic algorithms like genetic algorithm and Particle Swarm Optimization algorithm are popular to solve NP-complete problems. These algorithms are biology-inspired algorithms. Genetic algorithm became very popular due to its simplicity and accuracy. The Genetic algorithm will become slow for the problems larger in size. Hence, the Particle Swarm Optimization algorithm is combined with a genetic algorithm for faster convergence.

This paper’s main contribution is discussed as follows:

  1. (1)

    This paper presents a priority based task scheduler, which sort the user tasks based on the priority. Priority is calculated using task length and memory.

  2. (2)

    This paper illustrates the Hybrid Genetic-Particle Swarm Optimization algorithm (HGPSO) which takes the input from the on-demand queue and evaluates the suitable resources for the user tasks.

Finally, the proposed HGPSO algorithm is validated and compared with the other Meta-heuristic algorithms like genetic algorithm and Particle Swarm Optimization algorithm in a cloud simulated environment. The remaining contents of this paper are organized as follows. Section 2 discusses the related works and Sect. 4 explains the proposed methodology. Section 5 shows the results in detail and Sect. 6 presents the conclusion of the paper.

2 Related works

Ghanbari et al. [3] presented a priority based job scheduling method using mathematical statistics. This technique focused on the priority of the jobs. A multiple criteria decision model was used in the algorithm for calculating priority. Consistency and time are the issues related to this model. PSO and GA algorithms are combined and the three various hybrid strategies [4] are presented to find a better solution with faster convergence. In the first strategy, the crossover is applied over gbest particle with the GA chromosome. Here the gbest particle does not change its position. In the second strategy, pbest particles change their positions by the GA mutation operator. In the third strategy, GA’s solution is assigned as an initial population to the PSO. Total iterations are shared by GA and PSO. Hybrid algorithm HGAPSO is presented [5] for force based Simultaneous Analysis and Design by combining PSO with GA. Here PSO is used to enhance the elites by introducing cross over into the society.

Sossa and Buyya [6] presented a meta-heuristic optimization method to minimize the execution cost and satisfy the deadline constraints for workflows over IaaS clouds. Mudjihartono et al. [7] proposed Parallel GA-PSO algorithm to solve a job scheduling problem. The result of the proposed technique proved that it is faster than the standard GA algorithm. Meng et al. [8] presented a hybrid PSO algorithm which is fused with genetic algorithm (GA) and simulated annealing (SA). The proposed technique escaped from falling into a local minimum. The Results of the proposed technique are better than other hybrid PSO algorithm as it consumed lesser time for task completion.

Manasrah et al. [9] proposed a new workflow task scheduling in a cloud environment. The GA-PSO_HEFT algorithm selects VMs based on workflow task size and VM execution speed. Selected VMs execute the tasks in the minimum time. This GA_PSO_HEFT algorithm also executes tasks over the VMs with a balanced load distribution over slow and fast VMs. This technique reduces the makespan when compared with GA, PSO, HSGA, and WSGA algorithms. Also GA-PSO_HEFT algorithm improves the load balancing when compared with GA, PSO, and HSGA algorithms.

A hybrid task scheduling method [10] for cloud computing using genetic and PSO algorithm is introduced. In this technique, the cost function is used based on genetic and PSO algorithms. The Cost function evaluates the task execution time on resources in a cloud environment. These new models minimize the communication cost and critical path length. The results of the proposed model outperform other existing algorithms.

Various methods [11,12,13,14,15] and hybrid techniques are available with the combination of GA and PSO algorithms. But they do not optimize various QoS parameters. The proposed HGPSO algorithm focuses on various QoS parameters to be optimized.

3 Problem formulation

QoS parameters used in this work refer to execution time, scalability and availability.

\(T\): total time for execution, \(vm\): virtual machine, R: resource, \(St\): starting time of task execution on resource r, \(Ft\): finishing time of task execution on resource r, \(CTir\): completion time of task i on resource r, \(SCir\): scalability of resource, \(AVir\) = availability of resource.

$$CTir = \sum\limits_{i = 1}^{M} {Ft_{i} - St_{i} } ,{ 1} \le {\text{i}} \le {\text{M}},{ 1} \le {\text{r}} \le {\text{k}}$$
(1)
$$SCir = \sum\limits_{i = 1}^{M} {vm_{i} } /Rr,{ 1} \le {\text{i}} \le {\text{M}},{ 1} \le {\text{r}} \le {\text{k}}$$
(2)
$$AVir = \sum\limits_{i = 1}^{M} {vmi/T} ,{ 1} \le {\text{i}} \le {\text{M}},{ 1} \le {\text{r}} \le {\text{k}}$$
(3)

4 Proposed task scheduling model

The proposed Task scheduling model is shown in Fig. 1. User tasks are sent to the queue manager for evaluating the type of the tasks.

Fig. 1
figure 1

Task scheduling model

Queue manager will check the tasks that are in the task history. If the task type is already present, that task is sent to priority queue and task priority is assigned using priority based task scheduler and the required resource is allocated to the user task. If tasks are new and not in the history, that type of task is sent to the on-demand queue. This on-demand queue fetches the user tasks and forwards it to the HGPSO algorithm. An HGPSO algorithm accepts the user tasks as input and finds the suitable resources for the user tasks.

Initially, HGPSO calls the genetic algorithm to generate the initial population. Selection operation is used to find the fitted chromosomes from the population set. With the selected individuals from the GA, the PSO’s initial population is initiated. Before this, the population of GA is transformed into PSO particles. The PSO algorithm finds the best particles by finding through pbest and gbest methods. Best particle from PSO solution is transformed to GA for a crossover with the chromosome that is selected randomly from the fitted chromosomes.GA applies a mutation operation and suitable resources are assigned for the tasks.

4.1 Priority-based task scheduling

In this scheduling method, the user tasks are analyzed for the priority. Priority queue receives all the user tasks and checks the priority for all the tasks. Queue manager has a list of task history, which is executed previously. Priority is given to the tasks which are previously executed on the resources in the cloud. Priority is calculated based on task length and the memory size. Average task length and average memory required are calculated. Each task length and memory required is compared with the average task length and average memory. If checked values are less, the priority is set as high otherwise the priority is set as low.

figure c

4.2 HGPSO-based task scheduling

Figure 2 shows the task scheduling technique using HGPSO algorithm. The user tasks which are rejected by the priority queue are considered as input for the on-demand queue. The On-demand queue output is given to the HGPSO algorithm. HGPSO algorithm calls the GA algorithm to initialize the individuals. Chromosomes are encoded indirectly to represent the tasks and resources. Resources are represented by gene value. The fitness function given in Eq. (4) evaluates all the chromosomes in the population and fitted individuals are identified from the population.

Fig. 2
figure 2

HGPSO-based task scheduling

The fitness function is represented as follows

$$Fitness = \hbox{min} \sum_{ir} {\frac{1}{{CT_{ir} }} + \hbox{max} \sum_{ir} {(AV_{ir} + SC_{ir} )} }$$
(4)

In selection operation, ranking methods are applied to select the best individuals for further operation.The solution of the GA is transformed as PSO’s initial population by using the following function.

$$T_{i}^{S} (0) = \alpha .GA_{n}$$
(5)

\(\alpha\) is a constant and GAn is a solution of GA \(T_{i}^{S} (0)\) is an initial solution of PSO.

PSO initializes the particles using the random initialization operation of the PSO. PSO evaluates all the tasks against pbest and gbest values and that will be updated once the pbest and gbest values are greater. At every iteration, particles update the position and velocity based on the best values using Eq. (6).

$$V(t) = \omega v_{1} (t - 1) + k_{1} n_{1} (x_{1} \wedge \left( {t - 1} \right) - x_{1} \left( {t - 1} \right) + k_{2} n_{2} \left( {x^{*} \left( {t - 1} \right)} \right) - x_{1} \left( {t - 1} \right)$$
(6)

where \(x_{1} (t)\) is Position vector, \(i\) is Particle index, \(v_{1} (t)\) is velocity vector \(x_{1} \wedge \left( {t - 1} \right)\) is Position of particle,\(x\left( {t - 1} \right)\) is best particle’s position vector, \(n_{1}\) and \(n_{2}\) is random numbers between 0 and 1, \(k_{1}\) and \(k_{2}\) is positive constants, \(\omega\) is inertia factor.

The best particle value is encoded as GA’s chromosomes for crossover. This chromosome is crossed over with the chromosome which is selected randomly from the GA’s selection output. The brand new chromosome is generated and flip Mutation is applied to the offspring by swapping 1s to 0s and 0s to 1s that is generated in the crossover step to maintain the genetic diversity. Finally, the suitable resources that are given as output from the HGPSO algorithm are allocated to the user tasks.

figure d

5 Experimental results and analysis

In this section, experimental setup and result analysis are presented. The proposed Hybrid Genetic-Particle swarm optimization algorithm is experimented based on the execution time, availability and throughput. The result of the proposed technique is compared with the genetic algorithm and Particle swarm optimization algorithm.

Table 1 details the cloud simulation environment parameters. The maximum number of tasks taken is 50. 25 resources are considered for the simulation.

Table 1 Simulation parameters

Figure 3 shows the completion time for the proposed GA-PSO and it compares with the GA, PSO and GA_PSO_HEFT algorithms when the tasks vary from 10 to 50. It can be observed that completion time of proposed HGPSO algorithm is minimized when compared with GA and PSO algorithms.

Fig. 3
figure 3

Completion time

Figure 4 presents the scalability comparison between GA-PSO and GA, PSO algorithms when the tasks vary from 10 to 50. It can be concluded that scalability of proposed HGPSO algorithm is greater than GA, PSO and GA_PSO_HEFT algorithms.

Fig. 4
figure 4

Scalability

Figure 5 shows the availability of proposed GA-PSO and GA, PSO algorithms when the task values differ from 10 to 50. It can be noted that the availability of proposed HGPSO algorithm is higher than GA, PSO and GA_PSO_HEFT algorithms.

Fig. 5
figure 5

Availability

6 Conclusion

Task allocation plays a major issue in cloud computing environment. A hybrid task scheduling method is proposed in this paper.

Genetic and Particle Swarm Optimization algorithms are combined in this work to allocate the suitable resources to the user tasks. The proposed algorithm decreases execution time and improves availability and scalability rate when compared to genetic and particle swarm optimization algorithms. Furthermore, more QoS parameters will be considered as a novelty in improving the task allocation.