Energy Efficient Container Consolidation in Cloud

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 55

Energy Efficient Container

Consolidation in Cloud
Dimple Patel
218CS1086
Guide-Dr. Bibhudatta Sahoo
Cloud Computing
 Cloud: Something which is present at remote
location.

 Cloud Computing: Manipulating, configuring and


accessing the hardware and software resources
remotely.

2
What is Container?
 Virtual Machine
 A virtual machine (VM) is an operating system (OS) or
application environment that is installed on software,
which imitates dedicated hardware.
 Multiple VM can exist on one host at a time
 A virtual machine enables teams to run what appear
to be multiple machines on a single computer. If you
need to run software on a different type of hardware
or operating system, a VM provides that option
without using additional hardware.

3
Virtual Machine
VM1 VM2 VM3

App1 App2 App3

Bins/Libs Bins/Libs Bins/Libs

Guest OS Guest OS Guest OS

Hypervisor

Host Operating System

Hardware

4 Figure 1. Virtual machine


Advantages of Virtual Machine
 Multiple OS environments can exist simultaneously
on the same machine, isolated from each other.
 Easy maintenance, application provisioning,
availability and convenient recovery.

5
Disadvantages of Virtual Machine
 When multiple virtual machines are simultaneously
running on a host computer, each virtual machine may
introduce an unstable performance, which depends on
the workload on the system by other running virtual
machines.
 Virtual machines contain a complete operating system
and applications. Hypervisor-based virtualization is
resource intensive, a VM can take up several GB
depends on the guest the OS.

6
Container
 The container includes all the code, its dependencies and even the
operating system itself. This enables applications to run almost
anywhere.
 containers are far more lightweight, they share the OS kernel, start
much faster, and use a fraction of the memory compared to booting
an entire OS.
 Rather than spinning up an entire virtual machine, a container
packages together everything needed to run a small piece of
software.
 Instead of virtualizing the hardware stack as with the virtual
machines approach, containers virtualize at the operating system
level, with multiple containers running on top the OS kernel
directly.
 The primary difference is that with a VM, the team creates virtual
environments where different types of software can run. A
container, however, isolates the software from the environment in a
7
way that enables it to run most anywhere.
Container

Contianer1 Container2 Container3

App1 App2 App3

Bins/Libs Bins/Libs Bins/Libs

Container Runtime

Host Operating System

Hardware

8
Figure 2. Container Architecture
Advantages of Container
 The average container size is within the range of tens of MB
while VMs can take up several gigabytes. Therefore a server can
host significantly more containers than virtual machines.
 Running containers is less resource intensive then running VMs
so you can add more computing workload onto the same server.
 Provisioning containers only take a few seconds or less,
therefore, the data center can react quickly to a spike in user
activity.
 Containers can enable you to easily allocate resources to
processes and to run your application in various environments.

9
Container Vs Virtual Machine

VM1 VM2 VM3


App1 App2 App3
Bins/Libs Bins/Libs Bins/Libs
Contianer1 Container2 Container3

Guest Guest Guest App1 App2 App3


OS OS OS
Bins/Libs Bins/Libs Bins/Libs

Hypervisor Container Runtime

Host Operating System Host Operating System

Hardware Hardware

Figure 3. Comparison of VM and Container


10
Energy Consumption Challenges in Cloud
 The numerous advantages of cloud computing
environments, including cost effectiveness, on-
demand scalability, and ease of management,
encourage service providers to adopt them and
offer solutions via cloud.
 This in turn encourages platform providers to
increase the underlying capacity of their data
centers to accommodate the increasing demand of
new customers.
Disadvantages
 Need for more energy to power large-scale
infrastructures ( cloud data center ).

11
Motivation
 A single data center host up to several thousands of server s spread
across over 4500 square meters. A typical 500 square meter data
center can reach power consumption of 38 megawatt-hours (MWh)
per day, which is more than the power consumption of over 3500
households in EU.
 The energy consumption results in increased Total Cost of
Ownership (TCO) and consequently decreases the Return of
Investment (ROI) of the cloud infrastructure.
 Apart from low ROI, energy consumption has a significant impact
on carbon dioxide (CO2) emissions, which are estimated to be 2% of
global emissions [2].

12
Literature Review-1
 In paper [3], Albert Greenberg et al. Identify reason of
energy consumption such as inefficiency in data center
cooling system, network equipment and server
utilization. However, server are the main reason for
energy consumption.
 In paper [4], Ozmen Emre et al. compare the
performance and efficiency of VM(KVM) and
container(docker) and conclude that container offers
faster deployment , reduced resource consumption,
easier manageable and reduce energy consumption.

13
Literature Review-2
Sr. Authors Virtualiza Workloa Parameter Model
No. tion d considered

1. Dong et VM Google CPU Proposed a power model


al. cluster utilization, named as VPC, Use most
[6] Data Resource efficient server first (MESF)
2014 allocation for task placement

2. Piraghaj VM and Google Amount of X-mean clustering


et al. Container Cluster cores, amount algorithm for classifying
[7] Data of memory , task, define efficient VM size
2015 amount of for container placement
storage , task
capacity

Table 1. Summary of Literature review


14
Literature Review-2
Sr. Autho Virtual Workload Parameter Model
N rs ization considered
o.
3. Piragh VM and Google Overloaded and Build a model for
aj et Container cluster underloaded VM overload and under
al.[8], Data loaded container on
2015 virtual machine

4. Gaun et Container - Features of Build AODC model for


al. containers, cost optimization in Data
[9] various Center
2017 applications
requirement and
available
resources

Table 1. Continue Summary of Literature review


15
Literature Review-2
Sr. Autho Virtualization Workload Parameter Model
N rs considered
o.
5. Dong Container Synthetic Network Containerized
et al. cluster transition application scheduling in
[10] workload cost , energy cloud computing using
2017 consumption Linear Programming
cost, pulling Model
cost for
image
6. Hanafy Container and Planet lab Energy Max variance host
et. Al. VM data consumption, selection and most usage
[11] SLA, container selection
2017 Migration
Count

Table 1. Continue Summary of Literature review


16
Literature Review-2
Sr. Autho Virtualization Workload Parameter Model
N rs considered
o.
7. Chen VM CoMoin Energy Utilization based
Q. et al workload consuption, SLA, migration algorithm
[12] performance
2011

8. Tao Container and - CPU utilization Two stage multi-type


Shi. et VM particle swarm
al [13] optimization
2018 (TMPSO) algorithm

9 Carlos Container Random Balanced cluster NSGA-2 genetic


et. al data used, threshold algorithm
[14] distance, network
2017 distance, reliability

17
Table 1. Continue Summary of Literature review
Summary of literature review
 Most of the research is done on virtual machine.
 Not much research is done using Heuristic and
meta heuristic algorithm for container placement.
 Most of the paper have used cloudsim for the
simulation.

18
Problem Statement
For a given application, we have container set C {c1 ,c2
,c3 ,…, cn} where ci is a container of modules of an
application. Let Host machine set be H {h1 , h2 , h3 ,…,
hm }. Each host machines can be
homogeneous/heterogeneous. Container run on host
machine h. Find the efficient allocation of container
on host machine such that the overall energy
consumed by data center is minimized by minimizing
the number of running server.

19
Objective Function
 Assumptions: The application with its requirement
and dependencies are specified.
 Each of these application consists of independent
module and this modules are mapped to container.
 So, for each application, we have a set of container
{c1 , c2 , … cn }.
 Server is represented by it maximum processing
capacity, maximum memory size, idle power
consumption and maximum power consumption.
 Containers are represented by processing capacity
and memory required.

20
 The correlations between the server utilization and the electric
power consumption proposed by Eugen et al. is

P 𝑘 = (𝑃𝑘,𝑚𝑎𝑥 −𝑃𝑘,𝑖𝑑𝑙𝑒 ) . 𝑢𝑘 + 𝑃𝑘,𝑖𝑑𝑙𝑒


where, uk is utilization given by,
𝑢𝑘 = 𝑢𝑘𝑚𝑒𝑚𝑜𝑟𝑦 + 𝑢𝑘𝑐𝑝𝑢

where, ukmemory is memory utilization of kth server and ukcpu is CPU


utilization of kth server
𝑛
𝑖=1 𝑥𝑖_𝑚𝑒𝑚𝑜𝑟𝑦 𝑘
𝑢𝑘𝑚𝑒𝑚𝑜𝑟𝑦 = and
𝑚𝑒𝑚𝑜𝑟𝑦_𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦(𝑘)

𝑛
𝑖=1 𝑥𝑖_𝑐𝑝𝑢 𝑘
𝑢𝑘𝑐𝑝𝑢 =
𝑐𝑝𝑢_𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦(𝑘)
 Total power consumption is given by,
𝑚

𝑃= 𝑃(𝑘)
𝑘=1

21
Objective is
𝑚

𝑚𝑖𝑛 𝑃(𝑘)
𝑘=1
Subjected to
𝑛

𝑥𝑖_𝑚𝑒𝑚𝑜𝑟𝑦 𝑘 ≤ 𝑚𝑒𝑚𝑜𝑟𝑦_𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦(𝑘)
𝑖=1
and
𝑛

𝑥𝑖_𝑐𝑝𝑢 𝑘 ≤ 𝐶𝑃𝑈_𝑐𝑎𝑝𝑎𝑐𝑖𝑡𝑦(𝑘)
𝑖=1
Where 𝑥𝑖_𝑚𝑒𝑚𝑜𝑟𝑦 𝑘 and 𝑥𝑖_𝑐𝑝𝑢 𝑘 is the memory
consumption and CPU utilization of container i on server
k.
22
System Model

23
Figure 4. System Model
System Model
Parameters Assumed for given System Model
Servers type Homogeneous/Heterogeneous

Servers Maximum Processing Between 2000 to 8000 MIPS


Capacity

Containers Processing Capacity Between 500 to 3000 MIPS

Servers Memory Capacity 4GB, 8GB, 16GB, 32GB

Containers Memory Capacity Between 400 to 1000MB

Maximum Power Between 80 to 100W

Idle Power Between 10 to 20W

Table 2. Parameters assumed for given system model


24
Container Allocation Problem
 Same as bin packing problem
 NP-Hard problem as it is a combinatorial problem
where we need to place n number of container on k
server where k<n.
 Can be solved using heuristic and meta heuristic
algorithm.

25
Heuristic algorithm
 Provides sub optimal solution or near optimal
solution.
 Example
 First fit
 First fit decreasing
 Next fit
 Best fit
 Best fit decreasing

26
Comparing different heuristic algorithm

Figure 5. Comparison of different heuristic algorithm


27
Genetic Algorithm Flowchart

28 Figure 6. Flowchart of Genetic Algorithm


Genetic Algorithm
Parameters of Genetic Algorithm
Population Size 100

Number of Generation 250

Chromosome Size Equal to number of container

Selection Method Elitism

Crossover Method Uniform Crossover

Mutation Randomly changing 1 gene

𝑛
Fitness function
𝐸 = (𝑃𝑘,𝑚𝑎𝑥 −𝑃𝑘,𝑖𝑑𝑙𝑒 ) . 𝑢 + 𝑃𝑘,𝑖𝑑𝑙𝑒
𝑘=1
29 Table 3. Genetic Algorithm Parameter
Encoding Scheme

Figure 7. Representation of Chromosome

30
Population

Figure 8. Population Representation

31
Elitism Selection Method

Figure 9. Selection Method

32
Crossover

Figure 10. Crossover Method


33
Stopping Condition for Genetic Algorithm

Figure 11. 100 containers with 2000 iterations Figure 12. 200 containers with 2000 iterations

34
Stopping Condition for Genetic Algorithm

Figure 13. 300 containers with 2000 iterations Figure 14. 400 containers with 2000 iterations

35
Deciding Population Size

Figure 15. 50 containers with 250 iteration Figure 16. 100 containers with 250 iteration

36
Deciding Population Size

Figure 17. 200 containers with 250 iteration Figure 18. 300 containers with 250 iteration

37
Particle Swarm Optimization(PSO)

38 Figure 19. PSO Flowchart


Particle Swarm Optimization

Parameters considered for Particle Swarm Optimization


Number of Particle 100

Iteration Number 10

Number of Swarm Number of Container

𝑛
Fitness Function
𝐸 = (𝑃𝑘,𝑚𝑎𝑥 −𝑃𝑘,𝑖𝑑𝑙𝑒 ) . 𝑢 + 𝑃𝑘,𝑖𝑑𝑙𝑒
𝑘=1

Table 4. Parameter considered for PSO

39
Representation of a particle

Figure 20. Representation of a Particle

40
Update velocity and position
 Update velocity
Vi+1 = P1 . Vi + P2 .(Xlbest - Xi) + P3 .(Xgbest -Xi)

 Update position
Xi+1 = Xi * Vi+1

41
Subtraction
 If both the bits are same, then resultant bit is 1
otherwise 0.

Figure 21. Subtraction Operator

42
Addition
 If all the bits are same then the resultant bit value is
same otherwise the value depends on probability.
 The probability P1 , P2 and P3 is calculated as,
𝑓(𝑋𝑖)
P1i =
𝑓 𝑋𝑖 +𝑓 𝑋𝑙𝑏𝑒𝑠𝑡 +𝑓(𝑋𝑔𝑏𝑒𝑠𝑡)

𝑓(𝑋𝑙𝑏𝑒𝑠𝑡)
P2i =
𝑓 𝑋𝑖 +𝑓 𝑋𝑙𝑏𝑒𝑠𝑡 +𝑓(𝑋𝑔𝑏𝑒𝑠𝑡)

𝑓(𝑋𝑔𝑏𝑒𝑠𝑡)
P3i =
𝑓 𝑋𝑖 +𝑓 𝑋𝑙𝑏𝑒𝑠𝑡 +𝑓(𝑋𝑔𝑏𝑒𝑠𝑡)

43
Figure 22. Addition Operator

44
 For each # value, generate a random number.
 If random number > P1 then the corresponding bit
from velocity vector is selected.
 If P1 > random number > P2 then the corresponding
bit from velocity vector of local best particle is
selected.
 Otherwise, corresponding bit from velocity vector
of global best particle is selected.

45
Multiplication

Figure 23. Multiplication Operator

46
Stopping Condition

Figure 24. 50 task with 50 iteration Figure 25. 100 task with 50 iteration

47
Stopping Condition

Figure 26. 150 task with 50 iteration Figure 27. 200 task with 50 iteration

48
Deciding Population Size

Figure 28. 100 task with 50 iteration Figure 29. 200 task with 50 iteration

49
Result

Figure 30. Comparison of PSO, GA and best fit decreasing algorithm

50
Conclusion
 We implemented heuristic and metaheuristic algorithm.
 Next fit, best fit, best fit decreasing, first fit, first fit
decreasing algorithms are implemented and compared.
We got better result with best fit decreasing and first fit
decreasing algorithm
 Particle swarm optimization and genetic algorithm is
implemented and compared with best fit decreasing
algorithm.
 PSO performs better than Genetic algorithm as well as
best fit decreasing algorithm.
 PSO gives result in very less number of iteration.

51
Future Work
 Further energy consumption can be reduced using
different metaheuristic algorithm.
 Also energy consumption can be improved by
changing the parameter considered.
 Energy efficiency along with service level
agreement can be done as a future work.

52
References
1. C. Pahl, A. Brogi, J. Soldani, and P. Jamshidi. Cloud container technologies: A state-of-
the-art review. IEEE Transactions on Cloud Computing, 7(3):677–692, July 2019
2. R. Buyya, A. Beloglazov, and J. Abawajy, “Energy-efficient management of data center
resources for cloud computing: a vision, architectural elements, and open challenges,”
in Proceedings of 16th International Conference on Parallel and Distributed Processing
Techniques and Applications (PDPTA 2010), July 2010, pp. 6–17.
3. Albert Greenberg, James Hamilton, David A Maltz, and Parveen Patel. The cost of a
cloud: research problems in data center networks. ACM SIGCOMM computer
communication review, 39(1):68–73, 2008.
4. ¨OZMEN EMRE DEM˙IRKOL and AS¸KIN DEM˙IRKOL. Energy efficiency with an
application container. Turkish Journal of Electrical Engineering & Computer Sciences,
26(2):1129–1139, 2018.
5. Eugen Feller, Louis Rilling, and Christine Morin. Energy-aware ant colony based
workload placement in clouds. In Proceedings of the 2011 IEEE/ACM 12th
International Conference on Grid Computing, pages 26–33. IEEE Computer Society,
2011.
6. Ziqian Dong, Wenjie Zhuang, and Roberto Rojas-Cessa. Energy-aware scheduling
schemes for cloud data centers on google trace data. In `2014 IEEE Online Conference
on Green Communications (OnlineGreencomm), pages 1–6. IEEE, 2014.
53
References
7. Ziqian Dong, Wenjie Zhuang, and Roberto Rojas-Cessa. Energy-aware scheduling
schemes for cloud data centers on google trace data. In 2014 IEEE Online Conference
on Green Communications (Online Greencomm), pages 1–6. IEEE, 2014
8. S. F. Piraghaj, A. V. Dastjerdi, R. N. Calheiros, and R. Buyya. A framework and algorithm
for energy efficient container consolidation in cloud data centers. In 2015 IEEE
International Conference on Data Science and Data Intensive Systems, pages 368–375,
Dec 2015.
9. X. Guan, X. Wan, B. Choi, S. Song, and J. Zhu. Application oriented dynamic resource
allocation for data centers using docker containers. IEEE Communications Letters,
21(3):504–507, March 2017.
10. DongZhang, Bing-HengYan, ZhenFeng, ChiZhang, and Yu-XinWang. Container oriented
job scheduling using linear programming model. In 20173rdInternational Conference
on Information Management(ICIM), pages 174–180. IEEE, 2017.
11. W. A. Hanafy, A. E. Mohamed, and S. A. Salem. Novel selection policies for container-
based cloud deployment models. In 2017 13th International Computer Engineering
Conference (ICENCO), pages 237–242, Dec 2017.
12. Gargi Dasgupta, Amit Sharma, Akshat Verma, Anindya Neogi, and Ravi Kothari.
Workload management for power efficiency in virtualized data centers. Commun. ACM,
54:131–141, 07 2011.

54
References
13. Tao Shi, Hui Ma, and Gang Chen. Energy-aware container consolidation based on pso in
cloud data centers. In 2018 IEEE Congress on Evolutionary Computation (CEC), pages
1–8. IEEE, 2018.
14. Carlos Guerrero, Isaac Lera, and Carlos Juiz. Genetic algorithm for multi-objective
optimization of container allocation in cloud architecture. Journal of Grid Computing,
16(1):113–135, 2018
15. Netaji, Vhatkar Kapil, and G. P. Bhole. "Optimal Container Resource Allocation in
Cloud Architecture: A New Hybrid Model." Journal of King Saud University-
Computer and Information Sciences (2019).
16. Yesodha, R. & Amudha, T. (2012). A Comparative Study On Heuristic Procedures To
Solve Bin Packing Problems. International Journal in Foundation of Computer Science
& Technology (IJFCST). 2. 37-49. 10.5121/ijfcst.2012.2603.
17. Mala Kalra, Sarbjeet Singh, A review of metaheuristic scheduling techniques in cloud
computing,Egyptian Informatics Journal,Volume 16, Issue 3,2015,Pages 275-295,ISSN
1110-8665

55

You might also like