An Invocation Cost Optimization Method for Web Services in Cloud Environment

The advent of cloud computing technology has enabled users to invoke various web services in a “pay-as-you-go”manner. However, due to the flexible pricing model of web services in cloud environment, a cloud user’ service invocation cost may be influenced by many factors (e.g., service invocation time), which brings a great challenge for cloud users’ cost-effective web service invocation. In view of this challenge, in this paper, we first investigate the multiple factors that influence the invocation cost of a cloud service, for example, user’s job size, service invocation time, and service quality level; and afterwards, a novel Cloud Service Cost Optimization Method namedCS-COM is put forward, by considering the abovemultiple impact factors. Finally, a set of experiments are designed, deployed, and tested to validate the feasibility of our proposal in terms of cost optimization. The experiment results show that our proposed CS-COM method outperforms other related methods.


Introduction
The advent of cloud computing technology has provided us with a light-weight resolution for building various complex business applications [1][2][3].With the flexible provision of cloud computing infrastructure, a service user can invoke his/her interested web services in an "easy-to-access" and "pay-as-you-go" manner, which significantly benefits the users who request dynamic and variable computing resources [4][5][6].
However, the flexible pricing model in cloud environment brings users a challenging task to find the optimal service invocation cost [7], as the cost is often varied with many impact factors, such as user job size, service invocation time, and user's requested service quality [8].For example, let us consider a video-on-demand scenario [9,10] where a service V  can help users to enjoy movies located on remote servers.Then when V  is invoked by a user, the invocation cost often depends on many context factors, such as movie size, service invocation time, and movie display quality.Therefore, from the perspective of a cloud user, it becomes a necessity and a challenge to find the optimal service invocation time as well as the minimal service invocation cost, when he/she utilizes V  to enjoy his/her preferred movies.
In view of this challenge, in this paper, we first investigate and analyze the impact factors that influence the invocation cost of a cloud service; afterwards, a novel Cloud Service Cost Optimization Method, that is, CS-COM, is brought forth in this paper, by combining the above multiple impact factors.
The rest of paper is structured as follows.In Section 2, we first investigate the impact factors that influence the invocation cost of a cloud service.Afterwards, an optimization method for invocation cost of cloud services, that is, CS-COM, is put forward in Section 3, by considering the investigated multiple impact factors.A set of experiments are designed and deployed in Section 4, to validate the feasibility of our proposal in terms of cost optimization.Related works and further discussions are presented in Section 5.And finally, in Section 6, we conclude the paper and point out our future research directions.

Impact Factor Analyses for Web Service Invocation Cost in Cloud
Due to the flexible pricing models in cloud environment, the invocation cost for a cloud service is often not static but varied with many impact factors.In this section, we will investigate these context factors.Concretely, the following three context factors play important roles in cloud service charging.
2.1.Job Size.Size of a cloud user' job (or task), whose units are KB, MB, GB, TB, PB, and so forth.Generally, for a job of a cloud user, a larger job size often leads to longer service execution duration.Let us consider the example of V  introduced in Section 1.A 2 GB movie often takes more time cost (e.g., decoding time or transmission time) than a 1 GB movie does.With the above observation, a conclusion could often be drawn that there is a positive correlation between a user's job size and a cloud service's execution duration.Here, we utilize formula (1) to depict the relationship between them.Then according to the above analyses, in (1), the first-order derivative   ( ) > 0 often holds.Concretely, for simplicity, we utilize the three submodels in Figure 1 to depict the positive correlation between a cloud user's job size and a cloud service's estimated execution duration.As Figure 1 shows, a cloud service's estimated execution durations all increase with the growth of job size.The major difference among these three submodels is as follows: execution duration increases faster with the growth of job size in Figure 1(a) (e.g., when the cloud load is becoming heavier and heavier), while in contrast, execution duration increases more slowly when job size grows in Figure 1(b) (e.g., when the cloud load is becoming smaller and smaller); and in Figure 1(c), execution duration increases linearly with the growth of job size (e.g., when the cloud load stays approximately stable).

𝑒𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛 = 𝑓 (𝑗𝑜𝑏 𝑠𝑖𝑧𝑒) .
( For a cloud service, larger execution duration often means higher service invocation cost.Therefore, there is an indirect positive correlation between job size of a cloud user and invocation cost of a cloud service.For example, a 2 GB movie may be charged more than a 1 GB movie when a user invokes V  .

Service Invocation Time.
It means the time point that a cloud service begins to execute.Generally, a cloud user would be charged more when he/she invokes a cloud service in busy hours (e.g., 08:00 am∼18:00 pm of a day) or on busy days.In contrast, when the cloud service is not busy, a cloud user would be charged less.Let us take the V  introduced in Section 1, for example.If a user invokes V  service on free days (e.g., Monday∼Thursday), a small fee would be charged (i.e., cost per hour cph is low in Figure 2), while on other busy days (e.g., Friday∼Sunday), the invocation cost of V  would rise significantly due to the heavy network load on weekends.
Here, we utilize the following pricing model in (2) to depict the relationship between a cloud service's cph and invocation time point .Generally, the time-aware pricing model of a cloud service is often provided by its service provider.

𝑐𝑝ℎ = 𝑔 (𝑡) .
(2) 2.3.Service Quality Level.It means a cloud service's quality level that is requested by a cloud user.Generally, a cloud provider often publishes its cloud service with multiple quality levels so as to accommodate the various preferences of different cloud users [11].Here, we utilize set { 1 , . . .,   } to denote a cloud service's  service quality levels that could be delivered to its cloud users ( 1 denotes the lowest quality level, while   denotes the highest quality level).Generally, the service invocation cost would be high if a cloud user requests a high service quality level.For example, let us consider the example of V  (introduced in Section 1) as well as its two service quality levels shown as follows.As 1080 P > 720 P holds, a user would be charged more if he/she selects service-quality-level-1 instead of service-quality-level-2, as service-quality-level-1 requires more transmission cost than service-quality-level-2 does: service-quality-level-1: 1080 P (high video quality) service-quality-level-2: 720 P (middle video quality)

Cost Optimization Method for Cloud Service Invocation
In Section 2, we have analyzed the three important impact factors that are related to the invocation cost of a cloud service, that is, job size, service invocation time, and service quality level.Next, we combine the above three impact factors together to develop a novel cost optimization method for cloud services, that is, CS-COM, so as to help cloud users to find the optimal service invocation time and the minimal service invocation cost.Concretely, our proposed CS-COM method consists of the following four steps.
Step 1. Estimate a cloud service's execution duration based on a cloud user's job size.
In Section 2 (see Figure 1 and formula ( 1)), we have introduced three pricing submodels between a cloud user's job size and a cloud service's estimated execution duration.Therefore, given a cloud user's job size, we can estimate a cloud service's execution duration based on (1).Here, please note that formula (1) can be in the form of Figure 1(a) or Figure 1(b) or Figure 1(c), depending on the service provider's pricing strategy.Next, we utilize range [ 0 ,  0 + execution duration] to denote the running period of a cloud service, where  0 is the time point that the cloud service starts to execute.
Step 2. According to the estimated service execution duration (in Step 1) and the time-aware pricing model (in (2)), calculate the original service invocation cost P (without considering service quality level).

As introduced in
Step 1, a cloud service starts to execute at  =  0 and ends at  =  0 + execution duration.Therefore, through the integral operation over cph in (2), we can obtain the original service invocation cost P (without considering service quality level).Concretely, P could be calculated by (3), where ℎ = () holds (see formula (2)).
Step 3. Calculate the comprehensive service invocation cost  () based on the requested service quality level   and the original invocation cost  derived in Step 2.
In Step 2, we have derived the original invocation cost  of a cloud service without considering the service quality level.As analyzed previously in Section 2, service quality level often plays an important role in service charging.Therefore, in this step, original service invocation cost  is modified to be  ()  by considering the cloud user's requested service quality level   where   ∈ { 1 , . . .,   } holds (here, we assume that there are  quality levels for a cloud service;  1 and   denote the lowest and highest service quality levels, resp.).
As analyzed in Section 2, a higher service quality level often leads to larger service invocation cost.In view of this intuitive observation, we utilize the simple linear formula in (4) to depict the correlation between  () and .In (4),  and  are two parameters that are determined by the service quality level   .A concrete example is presented in Table  to demonstrate the relationship between parameter values of (, ) and service quality level   .Generally, parameters  and  could be obtained from the cloud service provider.
With Steps 1-4 of our proposed CS-COM method, we can determine the optimal service execution start time  0 as well as the optimal (i.e., the lowest) service invocation cost  ()  () , by considering a cloud user's job size and requested service quality level   .Next, more formally, the pseudocode of our proposed CS-COM method is specified as Algorithm 1.
Here, the functions execution duration = ( ) in (1), ℎ = () in (2), and parameters  and  are all regarded as known already, as they all depend on the pricing models of cloud service providers.

Experiments
In this section, a set of simulated experiments are designed and tested, to validate the feasibility of our proposed CS-COM method in terms of cost optimization.

Experiment Settings.
Next, we introduce the concrete parameters or environment settings adopted in the experiments.

Relationship between execution duration and job size (See Formula (1)).
As work [12] indicates, a cloud service's execution duration (without considering the data transfer between user client and cloud server) mainly depends on the CPU processing speed and user job size.Due to the flexible resource provision in cloud environment, we can assume that the CPU processing speed stays approximately stable.In this situation, there is an approximately linear relationship between estimated execution duration (unit: hour) of a cloud service and job size (unit: GB) of a cloud user.So in the experiments, we utilize the linear function in (7) to model their relationship where  ( > 0) is a parameter.Here, we utilize the well-known cloud simulation tool CloudSim [13] developed by Melbourne University for generating the user job 1000 times randomly, through which the user job size could be obtained.2)).Generally, a cloud service's pricing model, that is, cph (cost per hour), heavily depends on the service invocation time  [14].

Relationship between cph and t (See Formula (
In the experiments, we generate the random pricing models with the help of CloudSim (concretely, cloud services including pricing models in (1)-( 4) are encapsulated in a service entity in CloudSim and registered in CloudInfor-mationService component; our proposed cost optimization method CS-COM and other related methods are located in the component of Data Center Proxy so as to estimate the service invocation cost). () and Service Quality   (See Formula (4) and Table 1).According to the experiment results observed by [14], there is an approximate linear relationship between service invocation cost  () and service quality   (see formula (8)).In the experiments, we adopt this experienced data in (8) to approach formula (4) in our paper.

Relationship between Invocation Cost 𝑃
Besides, we test and compare our CS-COM method with four related methods: FCFS (First Come First Serve) [15], FL-FL (cost evaluation based on historical records) [16], Costplus (considering service invocation cost and user benefit simultaneously) [17], and CB (considering time-depended pricing model only) [14].
The experiments were conducted on a HP laptop with 2.40 GHz processors and 4.0 GB RAM.The machine is running under Windows 7 and JAVA 1.5.Each experiment was carried out 10 times and the average results were adopted.Concretely, three experiment profiles are tested and compared.

Profile 1: Invocation Cost Comparison with respect to
Job Size.In this profile, we test and compare the service invocation costs of our proposed CS-COM method and other four methods.Here, in CS-COM, parameters  = 2,  = 2, and  = 0.4 hold (see ( 8)); parameter  in FL-FL is equal to 3; parameter conversion = 0.4 holds in Cost-plus.Cloud user's job size is varied from 1 GB to 10 GB.
The experiment results are presented in Figure 3.As Figure 3 shows, the service invocation costs of five methods all increase with the growth of job size approximately; this is because processing a larger job often takes more time cost and hence leads to a higher invocation cost.Moreover, the service invocation cost of Cost-plus method is high as it considers the user benefit as an optimization object, while more user benefit often means higher charging fees.Besides, the service invocation cost of FCFS method often fluctuates frequently as its service invocation time is randomly selected, while different service invocation time means varied service charging.The rest three experiment curves increase approximately in polynomial manners, where FL-FL method utilizes the past service invocation costs to estimate the future invocation cost and CB method considers the time-dependent pricing models of cloud services, while our proposed CS-COM method consider a cloud user's job size, service invocation time, and requested service quality level simultaneously.Therefore, CS-COM method outperforms the other four methods in terms of service invocation cost, which could also be observed from Figure 3.

Profile 2: Invocation Cost Comparison with respect to
.In this profile, we compare the service invocation costs of five methods with respect to the service invocation time.As the "cph-t" charging models (see formula (2)) randomly generated by CloudSim make it hard to observe the stable variation trend of invocation cost, in this profile, we choose a randomly generated but fixed "cph-t" charging model ( ∈ [1:00 pm, 12:00 pm]) where [6:00 pm, 9:00 pm] is the busy hour.To observe the cost variation trend with invocation time , we tune parameter job size so that the user job could be finished within one hour.Other parameter settings are the same as in Profile 1.
The experiment results are shown in Figure 4.As Figure 4 indicates, the service invocation cost of Cost-plus is high as it considers both user benefit and service cost, while larger user benefit often means higher charging fees.The FCFS method achieves the approximate cost variation trend with the preset "cph-t" charging model as no cost optimization strategy is adopted in FCFS.In FL-FL method, sampling technique is recruited to approximately approach original "cph-t" charging model, which achieves the similar cost variation trend as in FCFS.The rest two methods, that is, CB and CS-COM, perform better than the previous three methods in terms of cost optimization, as the dynamic timeaware cost optimization strategy is considered in these two methods.Besides, as supposed in this profile, the execution duration of user job is one hour; therefore, at the last o' clock (i.e., 12:00 pm), time-aware cost optimization strategy does not work anymore and hence, the five cost variation curves converge.

Profile 3: Time Cost Comparison.
In this profile, we test the time costs of five methods.Here, sampling technique is recruited to convert the continuous function ℎ = () in (2) into  discrete values with same intervals, so as to facilitate the further computation of service invocation cost.Concretely,  = 100 holds in this profile.Other parameter settings are the same as those in Profile 1.
The concrete experiment results are presented in Figure 5.As can be seen from Figure 5, FL-FL method achieves the least time cost as it only considers the past few historical service invocation costs of a cloud service, without further complicated computation.The rest four time cost curves all increase approximately linearly with the growth of job size.The time cost of FCFS method is not very large as it only refers to an integral operation associated with ℎ = () and .The execution efficiencies of rest three methods, that is, Cost-plus, CB, and CS-COM, are very close, as they all contain some extra computation processes associated with cloud users' job size; concretely, Cost-plus needs to calculate the benefit of a cloud user based on the service invocation cost (derived based on job size) and CB needs to optimize the service invocation cost based on the time-dependent pricing model (depends on job size), while our proposed CS-COM method employs job size to estimate the service execution duration.As Figure 5 shows, the time costs of all the five methods are not high (at "millisecond" level).

Profile 4: Service Invocation
Cost of CS-COM with respect to .As formula (7) indicates,  is an important parameter that bridges the estimated service execution duration and a cloud user's job size and consequently influences the finally derived optimal service invocation cost.
In this profile, we test the relationship between  and the optimal service invocation cost in our proposed CS-COM method.Concretely,  is varied from 1 to 10, job size is equal to 1 GB, and parameters  = 2 and  = 0.4 hold in (4).
The concrete experiment results are presented in Figure 6.As can be seen from Figure 6, the invocation cost of CS-COM method increases approximately in a polynomial manner with the growth of , this is because  appears in the upper bound of  (i.e.,  0() + execution duration =  0() + ( )) of invocation cost integration ∫  0() +   0() () d in (6), while () is often a polynomial function associated with .So after the integral operation, the service invocation cost becomes a polynomial function associated with parameter .
From the above three sets of experiment results, we can conclude that our proposed CS-COM method outperforms the rest four methods in terms of service invocation cost (concretely, compared to FCFS, FL-FL, Cost-plus, and CB, the cost reduction ratios of our proposal are 74.9%,62.8%, 80.1%, and 35.1%, resp.).Besides, the time cost of our proposal is at the "ms" level, which is acceptable for most business applications.Finally, in our proposed CS-COM method, the derived optimal service invocation cost has a positive correlation with parameter  in formula (7), which approximately coincides with most existing cloud pricing models.Actually, for a cloud service, the value of parameter  could be published by its service provider in a flexible manner so as to maximize the economic gains.

Related Work and Comparison
Analyses.Cloud computing technology, on one hand, facilitates cloud users' sharing and use of various computing resources by providing an "easy-to-access" and "pay-per-use" resource provision manner and, on the other hand, brings a great challenge to minimize or optimize cloud users' service invocation cost.Many researchers have investigated this hot research topic and brought forth their respective resolutions [12,[14][15][16][17].
In [12], the authors divided the invocation cost of a cloud service into three categories: data-storage cost, CPU processing cost, and data-transfer cost.In order to evaluate and predict a cloud user's service invocation cost, FL-FL method was put forward in [16] by considering the service's past invocation costs; however, FL-FL method fails to generate an accurate service invocation cost as the latter is often influenced by some other factors.Work [17] analyzed the relationship between service invocation cost and user benefits and finally introduced a cost-benefit-aware cloud service scheduling method Cost-plus.However, one final optimization goal was to maximize user profits, not to minimize the service invocation cost.In order to minimize the service invocation cost, FCFS method was put forward in [15].FCFS adopted the "First Come First Serve" rule so as to reduce the waiting time of user job and optimize the service invocation cost.However, FCFS did not consider the dynamic and varied time-aware pricing model in cloud environment.In view of this, work [14] took the timedependent pricing model of cloud services into consideration and brought forth an invocation cost optimization method CB.However, CB method only considered service invocation time when optimizing the invocation cost, while neglecting some other important factors, for example, user job size and user's requested service quality level.
In view of the above shortcomings, a novel service invocation cost optimization method named CS-COM is put forward in this paper, which considers the multiple factors that influence the invocation cost in cloud environment.Experiment results show that CS-COM outperforms other related methods in terms of cost optimization.
(1) Only three factors (i.e., job size, service invocation time and service quality level) are considered in our cost optimization method named CS-COM, which are not enough for real cloud service scheduling applications.Therefore, in the future, we will further improve our proposal by introducing more charging factors.
(2) Users' subjective preferences that play an important role in users' final service invocation decisions are not considered in our proposed CS-COM approach.
In the future, we will refine our work by taking user preferences into consideration.

Conclusions
Cloud computing has provided an "easy-to-access" and "payper-use" resource delivery manner, to help users build their various complex business applications quickly and conveniently.However, due to the flexible pricing model of cloud services, a cloud service's invocation cost is often not fixed but varied, which brings a great challenge to optimize the service invocation cost when a cloud user requests a cloud service.In view of this challenge, we first analyze the multiple factors that may influence the invocation cost of a cloud service, for example, user job size, service invocation time, and service quality level.Afterwards, through considering the above multiple factors, a novel service invocation cost optimization method named CS-COM is put forward in this paper, to aid a cloud user to find the optimal service invocation start time as well as the lowest service invocation cost.Finally, through a set of simulated experiments deployed on CloudSim platform, we further demonstrate the feasibility and advantages of our proposed CS-COM method in terms of cost optimization.
In the future, we will further refine our proposed CS-COM method by introducing more charging factors, so as to make it more comprehensive and more applicable in real cloud service scheduling applications.

Figure 1 :
Figure 1: Positive correlation between job size of a cloud user and execution duration of a cloud service.

Figure 2 :
Figure 2: Cloud services' pricing model regarding invocation time : an example.

Figure 3 :
Figure 3: Invocation cost comparison of five methods with respect to job size.

Figure 6 :
Figure 6: Service invocation cost of CS-COM with respect to .

Table 1 :
An example of parameters  and  in (4).