Cost Optimize in Could Computing
Cost Optimize in Could Computing
Computing
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)
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