0% found this document useful (0 votes)
63 views

Cost Optimize in Could Computing

Cost Optimize in could computing

Uploaded by

paid work
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Cost Optimize in Could Computing

Cost Optimize in could computing

Uploaded by

paid work
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Inventory Theory Applied to Cost Optimization in Cloud

Computing

Andrea Nodari Jukka K. Nurminen Christian Frühwirth


Imperial College London (UK) Aalto University (FI) Nordcloud Oy (FI)
Aalto University (FI) Helsinki Institute [email protected]
[email protected] of Physics (FI)
[email protected]

ABSTRACT Services1 , allow customers to rent virtual machines of two


Cloud computing providers offer two different pricing schemes categories: on-demand instances and reserved instances. On-
when renting virtual machines: reserved instances and on- demand instances are virtual machines created and paid for
demand instances. On-demand instances are paid only when only when utilized. A cloud user adds and removes an on-
utilized and they are useful to satisfy a fluctuating demand. demand instance with maximum flexibility. Conversely, re-
Conversely, reserved instances are paid for a certain time pe- served instances are computational resources reserved and
riod and are independent of usage. Since reserved instances paid for a certain period, with an upfront fee. The latter
require more commitment from users, they are cheaper than category requires a higher level of commitment for the user;
on-demand instances. However, in order to be cost-effective therefore, if extensively utilized, they result to be cheaper
compared to on-demand instances, they have to be exten- during a long-term utilization.
sively utilized. This work focuses on finding the optimal In order to avoid unnecessary expenses, user of cloud re-
combination of on-demand and reserved instances, such that sources needs careful planning. On one hand, reserved in-
the demand is satisfied and the costs minimized. To achieve stances are useful for cost savings. On the other hand, if
this goal, this study introduces a stochastic model of the reserved instances are underutilized, they generate unnec-
resources, based on Inventory Theory. The idea is to for- essary costs. Therefore, the cost optimization problem we
mulate the optimization problem as an inventory-keeping investigate in this paper is how to satisfy the uncertain fu-
problem and then derive the optimal strategy. The pa- ture demand with a combination of reserved and on-demand
per evaluates the proposed model using data from an in- instances with minimum cost.
dustry case, comparing the performance with a brute-force
approach. The conducted experiments show that the Inven- In recent years, researchers have studied the field of cost
tory Theory model provides accurate results and potentially optimization in cloud computing. One of the most promis-
allows prior research on Inventory Theory to be applied to ing methods is to utilize Integer Programming to model the
optimal cloud provisioning. optimization problem [4, 5, 3]. Other authors exploit a two-
step approach: first, they propose a demand forecaster and
then, they aim to find an optimal solution with evolutionary
CCS Concepts algorithms [8, 11].
•Applied computing → Decision analysis; Nonetheless, current state-of-the-art approaches have some
limitations. In particular, some works propose stochastic
models to calculate the optimal number of reserved instances,
Keywords assuming the cumulative distribution function of the de-
Cloud provisioning; inventory theory; cost optimization; re- mand as available [3, 5, 7]. This paper aims to overcome
source allocation some of the limitations of state-of-the-art approaches, by
explaining how to use the model in real industry cases.
In addition, one of the key contributions of this study is
1. INTRODUCTION a novel application of Inventory Theory to the problem of
In recent years, cloud computing has become increasingly cost optimization in cloud computing. Inventory Theory is
popular. Cloud computing providers, such as Amazon Web a branch of operations research that aims to scientifically
describe the behavior of an inventory system. The idea is
Permission to make digital or hard copies of all or part of this work for to describe the cost optimization problem as an inventory-
personal or classroom use is granted without fee provided that copies keeping problem. After the formulation, it is possible to
are not made or distributed for profit or commercial advantage and that derive the optimal policy that minimizes the costs. This pa-
copies bear this notice and the full citation on the first page. To copy per shows the steps needed in order to utilize the findings
otherwise, or republish, to post on servers or to redistribute to lists,
requires prior specific permission and/or a fee. of the model with observed data. To the best of our knowl-
SAC 2016,April 04-08, 2016, Pisa, Italy edge, this is the first study that applies Inventory Theory to
Copyright 2016 ACM 978-1-4503-3739-7/16/04. . . $15.00
1
http://dx.doi.org/10.1145/2851613.2851869 https://aws.amazon.com
Symbol Description Starting from a empty inventory (i.e. no initial reserved
cod Hourly cost for an on-demand instance instances) the total cost of a period of N hours can be ex-
cri Effective hourly cost for a reserved in-
stance, which is the hourly cost amortized pressed as:
in a year of usage with the upfront fee N
y Number of reserved instances
X 
C(D, y) = cri y + cod max{0, di − y} (1)
D Random variable representing the demand
i=1
of instances
di ith observation of the demand Let us now assume D a continuous random variable with
C(D, y) Total cost to satisfy demand D with y re- probability density
R a fD (x), and cumulative distribution func-
served instances tion FD (a) = 0 fD (x) dx. In order to minimize the total
E[C(D, y)] Expected value of the total cost cost, the goal of the next step is to find the optimal value
fD Probability distribution function of the
demand for y, the number of reserved instance to purchase. The
FD Cumulative distribution function of the cost for an hour with demand D and y reserved instances is
demand expressed as follows.
−1
FD Quantile function of the demand
C(D, y) = cri y + cod max{0, D − y} (2)

Table 1: The parameters of the inventory theory Let us now calculate the expected value:
model. C(y) = E[C(D, y)] (3)
Z ∞
= C(x, y) fD (x) dx (4)
cost optimization in cloud computing. Further studies could Z0 ∞
follow this approach by applying other Inventory Theory
= (cri y + cod max{0, x − y}) fD (x) dx (5)
techniques in the context of cloud computing [1, 6]. 0
Z ∞
The model is validated using real data from a company ac-
= cri y + cod (x − y) fD (x) dx (6)
tive in cloud computing and compared with brute-force ap- y
proach.
At this point, it is necessary to minimize the expected total
cost by taking the derivative and set it to zero. Assum-
ing that the cost function has one point of minimum, the
2. INVENTORY THEORY MODEL expression is:
Inventory Theory is a branch of operations research focused Z ∞
on scientific inventory management. It aims to mathemat- C(y) = cri y + cod (x − y) fD (x) dx
ically describe an inventory system and to determine the Z y 0
optimal policies for minimizing the costs while satisfying de-
− cod (x − y) fD (x) dx (7)
mand [6]. 0
Z y
The problem of minimizing the cost by using reserved in- dC(y)
= cri − cod + cod fD (x) dx (8)
stances has remarkable similarities with the goals of Inven- dy
Z y0
tory Theory. Inventory Theory models help companies to
deal with stock of goods in order to minimize the costs. The = cri − cod [1 − fD (x) dx] (9)
0
goal of the model is to describe the optimal purchase in or-
der to satisfy the demand of a product. Similarly, in the = cri − cod [1 − FD (y)] = 0 (10)
context of cloud computing, the decision-makers manage a Solving this expression results in:
reserved instances portfolio and optimize purchases to sat-
cod − cri
isfy the demand with minimum cost. FD (y) = (11)
cod
Our work proposes a stochastic model which formulates the
Therefore, the value y such that the condition above holds,
total cost involved to satisfy the demand of computing ca-
minimize the cost. To demonstrate that the solution mini-
pacity as a random variable. Afterwards, the analytical solu-
mizes C(y), let us calculate the second order derivative and
tion to minimize the costs is found. The proposed approach
verify that it is ≥ 0 for every value of y.
follows Hillier et al. [6], which discuss the applications of
operations research in greater details. d2 C(y)
= cod fD (y) ≥ 0 (12)
The idea is to model the hourly cost to satisfy a certain dy
demand d using y reserved instances. If the reserved in-
stances are not sufficient to satisfy the demand, additional 3. EVALUATION
on-demand instances are added. The on-demand instances
The goal of the experiment is to validate the correctness of
are more expansive than reserved instances, using the Inven-
the proposed model (i.e. Equation 11). The result from the
tory Theory terminology this could be associated to shortage
model is compared with the result from Algorithm 1 which
costs.
is utilized to compute the ground-truth value for the opti-
The optimization is performed in a fixed amount of time of mal number of reserved instances. This simple brute-force
past data [2] and assumes observations to be independent algorithm computes the cost of satisfying the demand by
identically distributed. increasing the number of reserved instances, stopping when
80 1800

1600
70
Number of instances (Demand)

1400
60
1200

50

Cost ($)
1000

40 800

600
30
400
20
200

10 0
0 100 200 300 400 500 600 700 800 0 5 10 15 20 25 30 35 40
Hours Number of RIs

Figure 1: Obfuscated hourly distribution from the Figure 2: Costs varying the number of reserved in-
industry case. stances using the brute-force algorithm.

the costs increase. Figure 2 illustrates the result when run- The assumption made in these steps is that the observations
ning the algorithm. The input data is a real-world trace of are independent identically distributed. Extensive empirical
demand, representing the number of utilized instance each tests have been performed using different instance types and
hour (Figure 1). The trace has been obfuscated for confi- demand traces. The estimator of quantile outputs accurate
dentiality. results, always matching with the brute-force algorithm. For
more detailed results and explanations see [9].
Algorithm 1: Brute-force Approach
Data: hourlyDemand: number of instances per hour in a 4. DISCUSSION
certain time frame The experiment proves that the proposed model provide ac-
Result: optimal number of reserved instances curate results. The evaluation includes the assumption that
RIcounter ← min(hourlyDemand) the hourly values of demand are independent identically dis-
optimalRI ← 0 tributed. Although this assumption might lead to inaccu-
currentCost ← +∞ racy when applied to time series, it does not significantly
while true do decrease the performance in the experiments.
/* Calculate the cost using RIcounter reserved
instances */ A possible alternative to the proposed approach is to use
tmpCost ← calculateCost(hourlyDemand, RIcounter) the brute-force algorithm. Figure 3 illustrates the perfor-
if tmpCost ≤ currentCost then mance of the brute-force approach and the model. The ex-
optimalRI ← RIcounter periment is performed analyzing 30 days of data. The two
currentCost ← tmpCost approaches return the same results, however the brute-force
RIcounter ← RIcounter + 1 algorithm is slower than the model. In addition, the brute-
else force approach has unpredictable performance. While sort-
break ing n observations has complexity O(n log(n)), a brute-force
approach might have varying performance depending on the
initialization and the optimal number of reserved instances.
In order to apply the finding of the model to the data, it is This study shows that Inventory Theory accurately models
necessary to perform some preliminary steps. the dynamics of cost optimization in cloud computing. This
paper proposes a first application of Inventory Theory in this
Starting from Equation 11, assuming that FD is invertible
context, we believe that further work is possible, exploiting
we obtain the following.
the literature of Inventory Theory and applying some results
−1 cod − cri in the context of cloud computing [6].
 
y = FD (13)
cod
−1 −1
The function FD is a function such that FD (p) is the pth 5. RELATED WORK
quantile of the distribution. Therefore, we need to find the In the last years, researchers have analyzed the problem of
pth quantile of the observations of the demand, where p = finding the optimal number of reserved instances, given a
cod −cri
cod
. The algorithm to find the pth quantile is simple. certain demand.
Given N observations of the hourly demand, the steps are
the following. Chaisiri et al. [4] propose models based on Integer pro-
gramming. The work formulates the optimization problem
1. Sort d1 ...dN in d(1) ...d(N ) and solves it using stochastic integer programming. The
objective is to minimize the overall cost of the infrastruc-
cod −cri
2. Calculate p = cod
ture. The authors improve their work focusing of Amazon
Web Service offering [3]. They develop an algorithm for
3. Output D(⌈N p⌉) , where D⌈N p⌉ is the smallest ⌈N p⌉th cost optimization by provisioning of on-demand instances,
value of demand observations reserved instances, and spot instances. The model is based
Acknowledgements
30
This work has been developed at the R&D team at Nord-
25
cloud Oy2 . Part of the work was supported by the Green
Exection time (s)

20 Big Data project of Helsinki Institute of Physics.


15

10
7. REFERENCES
5
[1] T. Altiok and G. A. Shiue. Single-stage, multi-product
0
Brute-Force Model-Based
production/inventory systems. In American Control
Conference, 1991, pages 443–448. IEEE, 1991.
[2] R. V. D. Bossche, K. Vanmechelen, and
Figure 3: Efficiency of the brute-force and model- J. Broeckhove. Optimizing iaas reserved contract
based approach. procurement using load prediction. In Cloud
Computing (CLOUD), 2014 IEEE 7th International
Conference on, pages 88–95. IEEE, 2014.
on long-term and short-term provisioning algorithms Addi- [3] S. Chaisiri, R. Kaewpuang, B.-S. Lee, and D. Niyato.
tional improvements are also proposed to efficiently solve the Cost minimization for provisioning virtual servers in
optimization problem, which might be hard when the size of amazon elastic compute cloud. In Modeling, Analysis
the problem increases [5]. & Simulation of Computer and Telecommunication
Mark et al. [8] propose a two-step approach. First, the au- Systems (MASCOTS), 2011 IEEE 19th International
thors design a demand forecaster. The experiments show Symposium on, pages 85–95. IEEE, 2011.
accurate results of three algorithms: simple Kalman filter, [4] S. Chaisiri, B.-S. Lee, and D. Niyato. Robust cloud
Double Exponential Smoothing, and Markov Chains. The resource provisioning for cloud computing
next step utilizes a hybridized algorithm consisting of dif- environments. In Service-Oriented Computing and
ferent evolutionary algorithms for optimization: standard Applications (SOCA), 2010 IEEE International
Genetic Algorithm, Particle Swarm, and Ant Colony. The Conference on, pages 1–8. IEEE, 2010.
researchers compare the results with Stochastic Integer Pro- [5] S. Chaisiri, B.-S. Lee, and D. Niyato. Optimization of
gramming solution, showing similar results. resource provisioning cost in cloud computing.
Services Computing, IEEE Transactions on,
Another work studies how genetic algorithms are used to
5(2):164–177, 2012.
predict future demands [10]. The authors argue that a cru-
[6] F. S. Hillier and G. J. Lieberman. Introduction to
cial point for an effective planning is to understand future
stochastic models in operations research. McGraw-Hill
demand. The study shows the result of the experiments con-
Higher Education, 1995.
ducted using the load curve of four popular websites. The
evaluation demonstrates that Genetic Algorithms generate [7] Y.-J. Hong, J. Xue, and M. Thottethodi. Selective
accurate results. commitment and selective margin: Techniques to
minimize cost in an iaas cloud. In Performance
Other works provide a good explanation about how fore- Analysis of Systems and Software (ISPASS), 2012
casting techniques are used to design optimal plans [2]. At IEEE International Symposium on, pages 99–109.
first, future demand for each instance is calculated. The IEEE, 2012.
authors compare two approaches: Previous Period, that is [8] C. C. T. Mark, D. Niyato, and T. Chen-Khong.
to predict the future demand as equal to a previous period, Evolutionary optimal virtual machine placement and
and Double-Seasonal Holt-Winters time series analysis. The demand forecaster for cloud computing. In Advanced
experiments show that both approaches generate accurate Information Networking and Applications (AINA),
result, even if the latter is more effective than the former. 2011 IEEE International Conference on, pages
Another work thoroughly describes the problem of unneces- 348–355. IEEE, 2011.
sary costs in cloud computing [7] using reserved instances. [9] A. Nodari. Cost optimization in cloud computing.
The proposed algorithm looks at the utilization ratio of ex- Master’s thesis, Aalto University, 2015.
isting machines and evaluates whether purchasing a reserved [10] S. Stijven, R. Van den Bossche, E. Vladislavleva,
instance will be cost-effective. K. Vanmechelen, J. Broeckhove, and M. Kotanchek.
Optimizing a cloud contract portfolio using genetic
programming-based load models. In Genetic
6. CONCLUSION AND FUTURE WORK Programming Theory and Practice XI, pages 47–63.
This paper proposes a first application Inventory Theory in Springer, 2014.
the context of Cloud Computing. A potential improvement [11] S. Yousefyan, A. V. Dastjerdi, and M. R. Salehnamadi.
is to include discount rate to take into account the time Cost effective cloud resource provisioning with
value of money in the model. Moreover, a research direction imperialist competitive algorithm optimization. In
would be to model an entire purchase plan utilizing a multi- Information and Knowledge Technology (IKT), 2013
product inventory system [1], not only a single instance type. 5th Conference on, pages 55–60. IEEE, 2013.
Finally, a further improvement would be to formulate take
2
risks into account. http://nordcloud.com

You might also like