1 Introduction

Cloud computing is a combination of resources such as computing servers, database servers and storage servers. Cloud provides these services to the clients through pay-as-you-use policy. The major organizations like Microsoft [1] and Google [2] utilizes the cloud services as a cost effective solution. On the other side, the development of web applications and deployment in the cloud causes many challenges such as increase in cost and execution time to the cloud service providers [3,4,5]. Resource allocation based on the customer application requirements is the major issue in the cloud. Different algorithms are proposed to provide the solution for resource allocation problem. Distinct properties of the resources like broad network access and on-demand services offered by cloud service providers’ causes challenges to the customers for selecting the resources. Cloud service providers have the complex QoS policies and complex pricing strategy for their allocated resources. For instance, Amazon Web Services (AWS) [6] offers different type of services like, storage, computation, networking and database with different pricing models. Therefore, it is difficult to the customer to find the resources in their budget by considering QoS [3].

AWS OpsWorks [7], IBM Smart Cloud [8] and RightScale [9] are some of the tools used for the cloud management which can scale the services based on the customer requirements. These tools consider the application workload to scale the resources and also they are concentrated on reducing the deployment cost or workload demand but they are not concentrated on QoS performance [10,11,12]. The QoS performance is the major criteria in the perspective of customers. Misra et al. [12] elaborates on developing the algorithms to optimize the QoS performance along with the deployment cost using learning methods for cloud IaaS. In [13], the authors developed an optimization algorithm based on the objective function of minimizing the deployment cost and latency which is considered as QoS performance. In [14], the authors considered the factor of response time as the QoS to address the customer requirements.

In cloud data centers, the resource allocation is the major issue and commonly it is modelled as single objective function. Several models consider the QoS, deployment cost and energy consumption as the major objectives for problem formulation. In the proposed model, we considered the deployment cost and QoS performance as the major objectives to formulate the problem. The proposed algorithm uses branch and bound algorithm for finding the discrete solutions. The rest of the paper is organized as follows. Section 2 deals with the related work regarding the existing resource allocation methods. Section 3 explains about the problem formulation along with the resource allocation requirements. Section 4 deals with the optimization algorithm for resource allocation in cloud. Section 5 explains about the performance evaluation with respect to different workloads. Finally Sect. 6 concludes the research work.

2 Background

Cloud computing is the emerging platform that impacts the changes in the information technology. Resource allocation is the major concern that brings important research towards cloud computing. The enterprises are looking over the QoS requirements due to the increase in completion. The QoS is the major issue which should be considered at the time of allocating resources to the application. These papers address the two objectives such as deployment cost and QoS [15,16,17,18,19,20,21].

Many researchers addressed the issue of deployment cost in cloud. In [22], the author developed an algorithm for minimizing the deployment cost. In this algorithm, only one service provider is considered for deploying small scale and large scale applications. The results proved that the deployment cost is reduced up to 32% and the performance is reduced up to 5%. In [23], the authors considered the dynamic resource allocation and proposed the online resource allocation algorithm that reduced the deployment cost and resource rate. In [3], Huang et al. proposed the cloud model which considers the QoS requirements for service provisioning. The algorithm uses the directed acyclic graph for problem formulation. The algorithm showed the improvement in runtime and performance.

In [17], the authors adopted genetic algorithm for resource allocation and QoS requirements are also considered. But this algorithm has high runtime due to the problem complexity and also it requires pre-specified application requirements. In [19], the authors developed the dynamic programming algorithm for optimizing the QoS requirements and deployment cost. In this algorithm, the service level agreements and the response time are considered as the requirements for QoS. In [24], Nan et al. developed an algorithm to reduce the total cost of the application development. The QoS requirements considered for the application are response time of the database instance and computing instance [11, 27]. Hao Zheng et al. [28] developed an approach for hybrid energy-aware resource allocation whereas the authors of [29] details about multi-objective particle swarm optimization algorithm for Service allocation in the cloud environments.

3 Preliminaries

Cloud computing is responsible for providing many type of resources with different prices for executing applications in the cloud computing environment. The major issue in the cloud computing is selecting an exact combination of resources based on the requirements of the user is a crucial task. This section defines the problem formulation by examining the existing system. Figure 1 Shows the general architecture of resource scheduling in cloud computing.

Fig. 1
figure 1

Architecture of resource scheduling in cloud computing

3.1 Problem formulation

The problem is formulated for optimal allocation of cloud resources and it takes the input data from the resources offered by cloud service providers. Although, the service providers provide similar type of resources to the customer but they are different in terms of price range, QoS performance and service type. The service providers display all the information about the resources required by the customer. The detailed information is given in Table 1.

Table 1 Information about the cloud resources

The customers has to pay the price for the utilization of computing instance (Xc), database instance(Xdb), IO requests (XIO), storage space (Xs). In this research work, we are considered only the single cloud service provider. The rate of computing instance and the rate of the database also considered for the cloud based on the service level agreements. This problem statement also includes the requirements of the customers such as QoS and budget to deploy the application. In Table 2, the customer requirements are presented.

Table 2 Customer requirements for application deployment in cloud

The customer application deployment in the cloud requires different type of resources at different levels. Therefore, the customer has to purchase the resources to satisfy the application requirements. The resources which will be charged for the customer are given below.

  • Nc: Number of computing instances used by the application

  • Ndb: Number of database instances used by the application

  • Ns: Volume of storage required by each database instance

  • MRc: Minimum service rate offered by computing instance

  • MRdb: minimum service rate offered by database instance

The proposed algorithm is concentrated on developing the best combination of cloud resources. Therefore, the proposed algorithm optimizes the cloud resource variables.

Variable 1: Cost of the data base instance with respect to service time TD is given as

$$V_{1} = N_{db} \times (X_{db} + X_{s} \times N_{s} ) \times T_{D}$$
(1)

Variable 2: Cost of the data base server with respect to service time TD is given as

$$V_{2} = N_{c} \times X_{c} \times T_{D}$$
(2)

Variable 3: Cost of the Storage server with respect to service time TD is given as

$$V_{3} = (M_{Rdb} + M_{Rc} ) \times X_{IO} \times T_{D}$$
(3)

The deployment cost of the application into the cloud is given as follows and hence the waiting time of the resources allocation depends the cloud resource variables.

$$\delta = V_{1} + V_{2} + V_{3}$$
(4)

3.2 Cost optimization

The resource allocation problem is formulated by considering the total deployment cost along with customer requirements in the Data Center (DC) as the problem constraints. The QoS based cost optimization is given below:


Constrain 1: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(DC \le B_{\hbox{max} }\)


Constrain 2: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(T_{db} (M_{Rdb} ) \le \text{Re} sT_{db}\)


Constrain 3: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(T_{c} (M_{Rc} ) \le \text{Re} sT_{c} ;\)


Constrain 4: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(N_{c} \times R_{c} \ge E_{c} ;\)


Constrain 5: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(N_{db} \times R_{db} \ge E_{db} ;\)


Constrain 6: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(1 \le N_{c}\)


Constrain 7: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(\,1 \le N_{db}\)


Constrain 8: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(N_{db} \times N_{s} \ge \text{Re} g_{s}\)


Constrain 9: \(\mathop {Min}\limits_{{\{ N_{db} ,N_{c} ,N_{s} ,N_{Rdb} ,N_{Rc} \} }} DC\,\) such that \(\min_{s} \le N_{s} \le \max_{s}\)

The problem constraint 1 considered the customer budget for deploying the application. In problem constraints 2 and 3, represents the response time of the database servers and computing servers. In problem constraints 4, 5, 6 and 7 represents that the application has to utilize at least one database and one computing instance. In problem constraint 8 and 9 represents the storage requirements for the application.

4 QoS aware GA based resource allocation in cloud

In the proposed algorithm, many factors should be considered simultaneously to solve the problem. The main goal of the proposed algorithm is to balance the QoS performance and the deployment cost of the application at the time of resource allocation.

4.1 Requirements for QoS performance

To deploy the customer satisfied application into the cloud, several factors need to be considered. Those factors are response time of the database instance and response time of the computing instance. The response time of the database majorly depends on the expected demand (Edb). The database demand is modelled using passion distribution process. Equation 5 shows the response time of the database instance of an application with a service rate MRdb.

$$T_{db} (M_{Rdb} ) = \frac{{(M_{Rdb} )^{ - 1} }}{{1 - \frac{{E_{db} }}{{M_{Rdb} }}}}$$
(5)

The response time of the database instance should not be less than Tdb. The Tdb is the maximum value specified by the customer for response time of the database instance.

$$T_{db} (M_{Rdb} ) \le \text{Re} sT_{db}$$
(6)

Another major issue to deploy the application into the cloud is the response time of the computing instance. Assume that MRc is the minimum response time of the computing instances and the expected arrival rate of the application request to the computing instance are given as Ec. Equation 7 shows the model for response time of the computing instance.

$$T_{c} (M_{Rc} ) = \frac{{(M_{Rc} )^{ - 1} }}{{1 - \frac{{E_{c} }}{{M_{Rc} }}}}$$
(7)

The response time of the computing instance should not be less than the Tc. The Tc is the maximum response time set by the customer.

$$T_{c} (M_{Rc} ) \le \text{Re} sT_{c}$$
(8)

4.2 Resource allocation model

The two main objectives considered for the algorithm is reducing the deployment cost and improving the QoS performance. The mathematical model for resource allocation is as follows:

$$\begin{aligned} & {\text{Deployment}}\,{\text{Cost}}:\,\,\,{\text{Minimize}}\,\delta \\ & \quad \quad {\text{QoS}}\,{\text{performance}}:\,\,\,{\text{Maximize}}\,T_{db} (M_{Rdb} ),\,\,T_{c} (M_{Rc} ) \\ \end{aligned}$$
(9)

4.3 Algorithm for cloud resource allocation

The output of the proposed algorithm is guaranteed to be best optimal solution. However, the optimal solutions are continuous. In general, the cloud service providers offer discrete number of computing instances and database instances. Algorithm 1 is developed to find the suitable cloud resources based on the customer application requirements. Here, we considered the Genetic algorithm [26] for finding the optimal solutions. Genetic algorithm is considered as one of the suitable approach for solving the optimization problems which includes resource allocation.

4.3.1 Chromosome representation

In the chromosome representation, we considered the customer QoS requirements along with the available Resources. Equation 10 shows the chromosome representation in genetic algorithm.

$$\lambda (i,j) = Q_{i} (R_{j} )\quad {\text{Where}}\,\,{\text{i}} = 1 \ldots {\text{n}}\,\,{\text{and}}\,\,{\text{j}} = 1 \ldots {\text{m}}$$
(10)

Where λ(i,j) is the chromosome representation, ‘i’ is the QoS requirements and j is the available resources.

4.3.2 Initialization of the population

In genetic algorithm [26], population initialization is the major factor involved and the suitable population results in the fine-tuned outcome. Algorithm 1 shows the population initialization in genetic algorithm.

figure a

4.3.3 Fitness function

The fitness function is calculated for each chromosome which was initialized. This fitness function enhances the quality of the solution. The objective function of the resource allocation mechanism is to maximize the response time of the resources and reduces the deployment cost of the application. The fitness function of the two objectives is shown in Eq. 11.

$$f = w_{1} (\hbox{min} (\delta )) + w_{2} (\hbox{max} ((T_{db} (M_{Rdb} ),(T_{c} (M_{Rc} ))))$$
(11)

Where w1 and w2 denotes the priority of the objectives.

4.3.4 Cross over and mutation

Initially, two chromosomes are selected based on the random value G ϵ {0, 1}allocated for each chromosome. Cross over mechanism is applied for the chromosomes which are selected with the probability Pc random number G ∈ {0,1} assigned to each chromosome. If G < Pc then, the chromosomes follows the one point crossover. The low mutation level is maintained for the optimal results. Here, one single bit is position is changed in the chromosomes for performing the mutation.

5 Performance comparison

The proposed algorithm is developed with C++ that is run on Windows 10 OS with Intel Core i7, 1.7 GHz and 16 GB of RAM. The two workload benchmarks RUBiS [25] and SPEC [25] are considered for the evaluation. Table 3 shows the detailed characteristics of the two workloads.

Table 3 Input parameters of the proposed algorithm

The Amazon Web Services (AWS) [6] is considered as cloud service provider for deploying the workloads and the pricing is given in Table 4. The price of the resource is charged based on the usage.

Table 4 AWS parameters

The performance of the proposed model is compared with the QCost model [10]. The results are given in Table 5. From the table, it is observed that the proposed algorithm outperforms the existing algorithm. The deployment cost of the proposed model is less when compared to the QCost in both workloads.

Table 5 Results obtained for the proposed model and QCost [10]

The performance of the QoS genetic algorithm (QGA) is compared with the QCost algorithm [10] and Conventional algorithm [10]. The proposed algorithm considered the response time of the database, response time of the computation instance and deployment cost are the performance metrics considered for evaluation. Figure 2 shows the response time of the database instance. By observing the figure, it is proved that the proposed algorithm is efficient in reducing the response time of the database instance compared to the QCost and conventional algorithms. Figure 3 shows the response time of the computational instance. Though, proposed algorithm response time is less compared to other algorithms, it is slightly expensive compared to the QCost. Figure 4 shows the deployment cost of the proposed and existing algorithms. It is prove that, the proposed algorithm is efficiently balanced the trade-off between the QoS performance and the deployment cost.

Fig. 2
figure 2

Response time of the database instances with respect to QGA, Qcost and Conventional method

Fig. 3
figure 3

Response time of the computing instance QGA, Qcost and Conventional method

Fig. 4
figure 4

Deployment cost of the QGA, QCost and Conventional model

6 Conclusion

The major challenge faced by the cloud environment is resource allocation by satisfying the customer QoS requirements with in the budget. The customers can go through the cloud service providers to choose the optimal resources for their application deployment. Selecting the optimal resource is a big task to the customers with in the complex pricing structure. This paper proposed an optimal resource allocation method by considering the deployment cost and QoS requirements as the major objectives. The proposed algorithm uses the genetic algorithm for finding the best discrete solution to the problem. The experimental results are conducted over different workloads using the real time cloud service provider. The results proved that the proposed algorithm is efficient in balancing the trade-off between the deployment cost and QoS performance.