Week 1 - Lecture Notes
Week 1 - Lecture Notes
Cloud Computing
EL
PT
N
Dr. Rajiv Misra
Associate Professor
Dept. of Computer Science & Engg.
Indian Institute of Technology Patna
[email protected]
Cloud Computing and DistributedVuSystems
Pham Introduction to Cloud Computing
Preface
Content of this Lecture:
In this lecture, we will discuss a brief introduction to
Cloud Computing and also focus on the aspects i.e.
Why Clouds, What is a Cloud, Whats new in todays
EL
Clouds and also distinguish Cloud Computing from the
previous generation of distributed systems.
PT
N
EL
platform, network connectivity, and application workload.
Distributed computing system uses multiple computers to solve
large-scale problems over the Internet. Thus, distributed computing
PT
becomes data-intensive and network-centric.
The emergence of computing clouds instead demands high-
throughput computing (HTC) systems built with distributed
N
computing technologies.
High-throughput computing (HTC) appearing as computer clusters,
service-oriented architecture, computational grids, peer-to-peer
networks, Internet clouds, and the future Internet of Things.
EL
IDC in 2009: “Spending on IT cloud services will triple
in the next 5 years, reaching $42 billion.”
PT
Forrester in 2010 – Cloud computing will go from
$40.7 billion in 2010 to $241 billion in 2020.
N
Companies and even federal/state governments using
cloud computing now: fbo.gov
EL
– EBS: Elastic Block Storage
• Microsoft Azure
PT
• Google Compute Engine/AppEngine
• Rightscale, Salesforce, EMC,
N
Gigaspaces, 10gen, Datastax, Oracle,
VMWare, Yahoo, Cloudera
• And 100s more…
EL
Amazon S3 (Simple Storage Service): store arbitrary
datasets, pay per GB-month stored
PT
Amazon EC2 (Elastic Compute Cloud): upload and run
arbitrary OS images, pay per CPU hour used
EL
“With Online Services, reduce the IT operational costs by roughly 30% of
spending”
PT
“A private cloud of virtual servers inside its datacenter has saved nearly
crores of rupees annually, because the company can share computing
power and storage resources across servers.”
N
100s of startups can harness large computing resources without buying
their own machines.
EL
History:
In 1984, John Gage Sun Microsystems gave the slogan,
“The network is the computer.”
PT
In 2008, David Patterson UC Berkeley said,
“The data center is the computer.”
N
Recently, Rajkumar Buyya of Melbourne University simply said:
“The cloud is the computer.”
Some people view clouds as grids or clusters with changes through
virtualization, since clouds are anticipated to process huge data sets generated
by the traditional Internet, social networks, and the future IoT.
EL
A network topology, e.g., hierarchical
Storage (backend) nodes connected to the
network
Front-end for submitting jobs and receiving
client requests
PT
(Often called “three-tier architecture”)
Software Services
N
A geographically distributed cloud consists of
Multiple such sites
Each site perhaps with a different structure and
services
EL
communicating through message passing.
PT
Cloud computing: Clouds can be built with physical or
N
virtualized resources over large data centers that are distributed
systems. Cloud computing is also considered to be a form of
utility computing or service computing.
EL
1940
& Data Processing Industry
1950 Clusters
1960
Grids
PT 1970
PCs
(not distributed!)
1980
1990
N
2000
Peer to peer systems 2012
EL
Supercomputers
1940
Server Farms (e.g., Oceano)
1950
1960 P2P Systems (90s-00s)
EL
months.
Gilder’s law indicates that network bandwidth has doubled each
year in the past.
EL
In 1965, MIT's Fernando Corbató of the Multics operating
system envisioned a computer facility operating “like a
PT
power company or water company”.
Plug your thin client into the computing Utility and Play
Intensive Compute & Communicate Application
N
Utility computing focuses on a business model in which
customers receive computing resources from a paid
service provider.
All grid/cloud platforms are regarded as utility service providers.
EL
II. On-demand access: Pay-as-you-go, no upfront commitment.
– And anyone can access it
III. Data-intensive Nature: What was MBs has now become TBs, PBs and
IV.
XBs.
PT
– Daily logs, forensics, Web data, etc.
New Cloud Programming Paradigms: MapReduce/Hadoop,
N
NoSQL/Cassandra/MongoDB and many others.
EL
–
•
–
–
100K
PT
Split into clusters of 4000
AWS EC2 [Randy Bias, 2009]
N
– 40K machines
– 8 cores/machine
• eBay [2012]: 50K machines
• HP [2012]: 380K in 180 DCs
• Google: A lot
Cloud Computing and DistributedVuSystems
Pham Introduction to Cloud Computing
What does a datacenter look like from inside?
EL
Lots of Servers
PT
N
EL
Off-site
PT
N
On-site
•Air sucked in
EL
•Moves cool air through system
PT
N
EL
HaaS: Hardware as a Service
Get access to barebones hardware machines, do whatever
you want with them, Ex: Your own cluster
PT
Not always a good idea because of security risks
IaaS: Infrastructure as a Service
Get access to flexible computing and storage infrastructure.
N
Virtualization is one way of achieving this. subsume HaaS.
Ex: Amazon Web Services (AWS: EC2 and S3), OpenStack,
Eucalyptus, Rightscale, Microsoft Azure, Google Cloud.
EL
(often tightly coupled)
Ex: Google’s AppEngine (Python, Java, Go)
PT
SaaS: Software as a Service
Get access to software services, when you need
them. subsume SOA (Service Oriented
N
Architectures).
Ex: Google docs, MS Office on demand
EL
Data-Intensive
Typically store data at datacenters
PT
Use compute nodes nearby
Compute nodes run computation services
N
In data-intensive computing, the focus shifts
from computation to the data:
CPU utilization no longer the most important
resource metric, instead I/O is (disk and/or network)
EL
• Indexing: a chain of 24 MapReduce jobs
• ~200K jobs processing 50PB/month (in 2006)
PT
Yahoo! (Hadoop + Pig)
• WebMap: a chain of several MapReduce jobs
• 300 TB of data, 10K cores, many tens of hours (~2008)
N
Facebook (Hadoop + Hive)
• ~300TB total, adding 2TB/day (in 2008)
• 3K jobs processing 55TB/day
NoSQL: MySQL is an industry standard, but Cassandra is 2400 times faster
EL
Example of popular vendors for creating private
clouds are VMware, Microsoft Azure, Eucalyptus etc.
customer PT
Public clouds provide service to any paying
EL
from 2009) Storage = $ 0.12 X 524 X 1000 ~ $62 K
– Total = Storage + CPUs = $62 K + $0.10 X 1024 X 24 X 30 ~ $136 K
• Own: monthly cost
–
EL
- Scale, On-demand access, data-intensive,
new programming
PT
N
EL
PT
N
Dr. Rajiv Misra
Associate Professor
Dept. of Computer Science & Engg.
Indian Institute of Technology Patna
[email protected]
Cloud Computing and DistributedVuSystems
Pham Virtualization
Preface
EL
In this lecture, we will discuss virtualization technology
its importance, benefits, different models and key
approaches to virtualization in CPU, Memory and
PT
Device Virtualization.
N
EL
applications) on the same physical
machine.
PT
Virtual resources = each OS thinks
that it “owns” hardware resources
Virtual machine (VM) =
N
OS+ applications + virtual resources
(guest domain)
Virtualization layer = management of
physical hardware (virtual machine
monitor, hypervisor)
Cloud Computing and DistributedVuSystems
Pham Virtualization
Defining Virtualization
A virtual machine is an efficient,
isolated duplicate of the real machine.
EL
Supported by a virtual machine
monitor (VMM):
1. Provides environment essentially
PT
identical with the original machine
2. Programs show at worst only minor
N
decrease in speed.
3. VMM is in complete control of
system resources. VMM Goals: Fidelity
(This means that the virtual machine monitor has Performance
full control to make decisions, who accesses which
resources and when) Safety & isolation
Cloud Computing and DistributedVuSystems
Pham Virtualization
Benefits of Virtualization
Consolidation: It is this ability to run multiple virtual machines, with
their operating systems and applications on a single physical platform.
- Decrease cost, improve manageability (with fewer admins and with
fewer electrical bills)
EL
Migration: Migrate the OS in the applications from one physical
machine to another physical machine.
- Greater availability of the services, improve reliability
PT
Security: As the OS and the applications are nicely encapsulated in a
virtual machine. It becomes more easy to contain any kinds of bugs, or
N
any kinds of malicious behavior, to those resources that are available
to the virtual machine only, and not to potentially affect the entire
hardware system.
Some other benefits: Debugging, Provide affordable Support for
legacy OSs
1. Bare-metal hypervisor
EL
or Native Hypervisor (Type 1)
PT
2. Hosted Hypervisor (Type 2)
N
EL
hardware resources and supports
execution of entire VMs.
PT
Privileged, service VM to deal with
devices (and other configuration
N
and management task)
EL
- The VMs that are run in the virtualized
environment are referred to as domains.
- The privileged domain is called dom 0, and
PT
the guest VMs are referred to as domUs.
- Xen is the actual hypervisor and all of the
drivers are running in the privileged domain,
in dom 0.
N
(ii) ESX (VMware)
-Given that VMware and its hypervisors were first to market, VMware still owns the
largest percentage of virtualized server cores. So these server cores run the ESX
hypervisor and also provide the drivers for the different devices. That are going to
be part of the hypervisor. To support a third party community of developers
VMware exports a number of APIs.
Cloud Computing and DistributedVuSystems
Pham Virtualization
Hosted virtualization model
Hosted Hypervisor (Type 2)
EL
manages all of the hardware
resources.
PT
The Host OS integrates a VMM
module, that's responsible for
N
providing the virtual machines with
their virtual platform interface and
for managing all of the context
switching scheduling, etc.
EL
KVM kernel module +
hardware emulator
called QEMU for
EL
Ring 3: In contrast, ring 3 has the least
level of privilege, so this is where the
PT
applications would reside.
EL
PT
N
EL
hardware speeds=> efficiency
-for privileged operations: trap to hypervisor
PT
N
Hypervisor determines what needs to be done:
If illegal operation: terminate VM
If legal operation: emulate the behavior the guest OS was
expecting from the hardware
EL
BUT: 17 privileged instructions do not
trap! Fail silently!
E.g. interrupt enable/disable bit in
PT
privileged register; POPF/PUSHF
instructions that access it from ring 1 fail
silently
N
Hypervisor doesn’t know, so it doesn’t
try to change settings
OS doesn’t know, so assumes change
was successful/
Cloud Computing and DistributedVuSystems
Pham Virtualization
Binary Translation
Main idea: rewrite the VM binary to never issue those 17
instructions
EL
commercialized as Vmware
PT
Rosenblum awarded ACM Fellow for “reinventing
virtualization”
N
EL
translation
1. Inspect code blocks to be executed
PT
2. If needed, translate to alternate
instruction sequence
N
-e.g., to emulate desired behavior,
possibly even avoiding trap
3. Otherwise, run at hardware speeds
Fig.: Binary translation approach to
-Cache translated blocks to amortize x86 virtualization
translation costs
Cloud Computing and DistributedVuSystems
Pham Virtualization
Para virtualization
Goal: performance; give up on
unmodified guests
Approach: Para virtualization
=modify guest so that
EL
It knows it’s running virtualized
It makes explicit calls to the
hypervisor (hypercalls)
PT
Hypercall (~system calls)
- Package context info
N
- Specify desired hypercall
- Trap to VMM
- e.g. Xen= open source hypervisor
(XenSource -> Citrix)
EL
50%
30%
2% PT
Answer: less than 2%.
N
This can be shown by a proof-of-construction by
XEN
Xen is a para virtualized hypervisor.
Cloud Computing and DistributedVuSystems
Pham Virtualization
Memory Virtualization
To run multiple virtual machines on a single system, one has to
virtualize the MMU(memory management unit) to support the
guest OS.
EL
The VMM is responsible for mapping guest physical memory to
the actual machine memory, and it uses shadow page tables to
PT
accelerate the mappings.
EL
miss
PT PT
N
CPU uses PT for address translation
Hardware PT is really the S PT(shadow Page Table)
EL
addresses and page frame numbers
-Still leverages hardware MMU, TLB
Option 1:
-Hypervisor: PA=> MA
PT
-Guest page table: VM => PA
Option 2:
-Guest page table: VA => PA
-Hypervisor shadow Page Table:
N
-Too expensive VA=> MA
-Hypervisor maintains consistence
e.g. invalidate on ctx switch,
write-protect guest PT to track new
mappings
Cloud Computing and DistributedVuSystems
Pham Virtualization
Memory Virtualization
Para virtualization
-Guest aware of virtualization
-No longer strict requirement
on contiguous physical
EL
P2
P1
memory starting at 0
-Explicitly registers page Guest OS
PT
tables with hypervisor
-Can “batch” page table
updates to reduce VM exists
Hypercalls
{
•
•
•
Create PT
Switch PT
Update PT
N
HYPERVISOR
-Other optimizations
• Overheads eliminated or
reduced on newer platforms
Cloud Computing and DistributedVuSystems
Pham Virtualization
Device Virtualization
For CPUs and memory
Less diversity, ISA (instruction set architectures)level
standardization of interface
EL
For devices
High diversity
behavior PT
Lack of standard specification of device interface and
EL
the device
VM can directly access the device (also
called VMM-bypass model)
PT
Device sharing will become difficult.
VMM must have exact type of device
N
as what VM expects
VM migration is tricky
EL
- traverse VMM-resident I/O stack
- invoke VMM-resident driver
Key benefits: PT
N
VM decoupled from physical device
Sharing, migration, dealing with device specifies
Downside of the model
Latency of device operations
Device driver ecosystem complexities in hypervisor
Cloud Computing and DistributedVuSystems
Pham Virtualization
(iii) Split-Device Driver Model
Approach:
Device access control split between
-Front end driver in guest VM (device
EL
API)
-Back-end driver in service VM (or host)
Modified guest drivers
PT
i.e. Limited to para virtualized guests
N
Eliminate emulation overhead allow
for better management of shared
devices
EL
We have also described processor virtualization, memory
virtualization and device virtualization used in virtualization
PT
solutions, such as Xen, KVM and the VMware .
N
EL
PT
N
Dr. Rajiv Misra
Associate Professor
Dept. of Computer Science & Engg.
Indian Institute of Technology Patna
[email protected]
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Preface
Content of this Lecture:
EL
techniques to automate the task of monitoring and
detecting hotspots by determining a new mapping of
physical to virtual resources and initiating the necessary
migrations. PT
N
We will discuss a black-box approach that is fully OS- and
application-agnostic and a gray-box approach that exploits
OS- and application-level statistics.
EL
Multiple applications per server
Shared hosting environment
PT
Multi-tier, may span multiple servers
EL
Rapidly adjust resource allocations
CPU priority, memory allocation
VM migration PT
“Transparent” to application
N
No downtime, but incurs overhead
EL
growth, time-of-day effects, and flash crowds etc
PT
140000
1200
60000
40000
20000
N
0
0 5 10 15 20
0
0 1 2 3 4 5 Time (hrs)
Time (days)
How can we provision resources to
meet these changing demands while meeting
SLAs is a complex task?
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Provisioning Methods
Hotspots form if resource demand exceeds provisioned
capacity
Over-provisioning
EL
Allocate for peak load
• Wastes resources
• Not suitable for dynamic workloads
PT
• Difficult to predict peak resource requirements
N
Dynamic provisioning
Adjust based on workload
• Often done manually
• Becoming easier with virtualization
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Problem Statement
How can we automatically (i) monitoring for
resource usage,(ii) hotspot detection, and (iii) mitigation ie
determining a new mapping and initiating the
EL
necessary migrations (ie detect and mitigate
Hotspots) in virtualized data centers?
PT
N
EL
and where in order to dissipate the hotspot.
Determining a new mapping of VMs to physical servers that
avoids
PT
threshold violations is NP-hard—the
multidimensional bin packing problem can be reduced to
this problem, where each physical server is a bin with
N
dimensions corresponding to its resource constraints and
each VM is an object that needs to be packed with size equal
to its resource requirements.
Even the problem of determining if a valid packing exists is
NP-hard.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Research Challenges
Hotspot Mitigation: automatically detect and mitigate hotspots
through virtual machine migration
EL
When to migrate?
EL
Dynamic slicing:
In dynamic slicing, the fraction of a server allocated to an application is
varied.
Application migration:
PT
N
In the virtualization, VM migration is performed for dynamic provisioning.
Migration is transparent to applications executing within virtual machines.
EL
Runs inside a special virtual server
(domain 0 in Xen)
Control Plane
Centralized server
Hotspot Detector
PT
N
Detect when a hotspot occurs
Profiling Engine
Decide how much to allocate
Migration Manager PM = Physical Machine
VM = Virtual Machine
Determine where to migrate
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Black-Box and Gray-Box
Black-box: only data from outside the VM
Completely OS and application agnostic
EL
??? Application logs
OS statistics
PT
Gray-Box: access to OS stats and application logs
N
Request level data can improve detection and profiling
Not always feasible – customer may control OS
Is black-box sufficient?
What do we gain from gray-box data?
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Black-box Monitoring
Xen uses a “Driver Domain”
Special VM with network and disk drivers
Nucleus runs here
VM
CPU
EL
Driver
Domain
Scheduler statistics
Network
PT
Linux device information
Nucleus
Hypervisor
N
Memory
Detect swapping from disk I/O
Only know when performance is poor
EL
the duration for which each virtual machine is scheduled
within each measurement interval I.
PT
Network Monitoring: Domain-0 in Xen implements the
network interface driver and all other domains access the
N
driver via clean device abstractions. Xen uses a virtual
firewall-router (VFR) interface; each domain attaches one or
more virtual interfaces to the VFR. Doing so enables Xen to
multiplex all its virtual interfaces onto the underlying
physical network interface.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Black-box Monitoring
Memory Monitoring: Black-box monitoring of memory is
challenging since Xen allocates a user specified amount of
memory to each VM and requires the OS within the VM to
manage that memory; as a result, the memory utilization is only
known to the OS within each VM.
EL
It is possible to instrument Xen to observe memory accesses
PT
within each VM through the use of shadow page tables, which is
used by Xen’s migration mechanism to determine which pages
are dirtied during migration.
N
However, trapping each memory access results in a significant
application slowdown and is only enabled during migrations.
Thus, memory usage statistics are not directly available and
must be inferred.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Black-box Monitoring
Black-box monitoring is useful in scenarios where it is not
feasible to “peek inside” a VM to gather usage statistics.
Hosting environments, for instance, run third-party
applications, and in some cases, third-party installed OS
distributions.
EL
Amazon’s Elastic Computing Cloud (EC2) service, for instance,
provides a “barebone” virtual server where customers can load
PT
their own OS images.
While OS instrumentation is not feasible in such environments,
there are environments such as corporate data centers where
N
both the hardware infrastructure and the applications are
owned by the same entity.
In such scenarios, it is feasible to gather OS-level statistics as
well as application logs, which can potentially enhance the
quality of decision making.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Gray-box Monitoring
Gray-box monitoring can be supported, when feasible, using a
light-weight monitoring daemon that is installed inside each
virtual server.
In Linux, the monitoring daemon uses the /proc interface to
EL
gather OS level statistics of CPU, network, and memory usage.
The memory usage monitoring, in particular, enables proactive
detection and mitigation of memory hotspots.
PT
The monitoring daemon also can process logs of applications
such as web and database servers to derive statistics such as
request rate, request drops and service times.
N
Direct monitoring of such application-level statistics enables
explicit detection of SLA violations, in contrast to the black-box
approach that uses resource utilizations as a proxy metric for
SLA monitoring.
EL
Before the hotspot can be resolved through migrations,
PT
The system must first estimate how much additional
resources are needed by the overloaded VMs to fulfill
their SLAs; these estimates are then used to locate servers
N
that have sufficient idle resources.
EL
Hotspot detection is performed on a per-physical server
basis in the black-box approach—a hot-spot is flagged if the
aggregate CPU or network utilizations on the physical server
PT
exceed a threshold or if the total swap activity exceeds a
threshold.
N
In contrast, explicit SLA violations must be detected on a
per-virtual server basis in the gray-box approach—a hotspot
is flagged if the memory utilization of the VM exceeds a
threshold or if the response time or the request drop rate
exceed the SLA-specified values.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Hotspot Detection
To ensure that a small transient spike does not trigger needless
migrations, a hotspot is flagged only if thresholds or SLAs are exceeded
for a sustained time. Given a time-series profile, a hotspot is flagged if at
least k out the n most recent observations as well as the next predicted
value exceed a threshold. With this constraint, we can filter out transient
EL
spikes and avoid needless migrations.
The values of k and n can be chosen to make hotspot detection
aggressive or conservative. For a given n, small values of k cause
PT
aggressive hotspot detection, while large values of k imply a need for
more sustained threshold violations and thus a more conservative
approach.
N
In the extreme, n = k = 1 is the most aggressive approach that flags a
hostpot as soon as the threshold is exceeded. Finally, the threshold itself
also determines how aggressively hotspots are flagged; lower thresholds
imply more aggressive migrations at the expense of lower server
utilizations, while higher thresholds imply higher utilizations with the risk
of potentially higher SLA violations.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Hotspot Detection
In addition to requiring k out of n violations, we also
require that the next predicted value exceed the threshold.
EL
The additional requirement ensures that the hotspot is
likely to persist in the future based on current observed
PT
trends. Also, predictions capture rising trends, while
preventing declining ones from triggering a migration.
N
EL
consider a sequence of observations: u1, u2, ..., uk. Given this time
series, we wish to predict the demand in the (k + 1)th interval. Then
the first-order AR(1) predictor makes a prediction using the previous
PT
value uk, the mean of the time series values μ, and the parameter
which captures the variations in the time series. The prediction ˆuk+1
is given by:
N
As new observations arrive from the nuclei, the hot spot detector
updates its predictions and performs the above checks to flag new
hotspots in the system.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Hotspot Detection – When?
Resource Thresholds
Potential hotspot if utilization exceeds threshold
Only trigger for sustained overload
EL
Must be overloaded for k out of n measurements
Autoregressive Time Series Model
PT
Use historical data to predict future values
Minimize impact of transient spikes
N Utilization
Utilization
Utilization
Time Time Time
Not overloaded Hotspot Detected!
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Resource Provisioning: Black-box Provisioning
The provisioning component needs to estimate the peak CPU,
network and memory requirement of each overloaded VM;
doing so ensures that the SLAs are not violated even in the
presence of peak workloads.
EL
Estimating peak CPU and network bandwidth needs:
Distribution profiles are used to estimate the peak CPU and
PT
network bandwidth needs of each VM. The tail of the usage
distribution represents the peak usage over the recent past
N
and is used as an estimate of future peak needs.
EL
then the work conserving Xen scheduler will allocate 70% to
VM1.
PT
In this case, the tail of the observed distribution is a good
indicator of VM1’s peak need. In contrast, if VM2 is using its
N
entire fair share of 50%, then VM1 will be allocated exactly its
fair share. In this case, the peak observed usage will be 50%, an
underestimate of the actual peak need. Since the system can
detect that the CPU is fully utilized, it will estimate the peak to
be 50 +∆ .
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Resource Provisioning: (i) Black-box Provisioning
Estimating peak memory needs: Xen allows a fixed amount of
physical memory to be assigned to each resident VM; this
allocation represents a hard upper-bound that can not be
exceeded regardless of memory demand and regardless of
the memory usage in other VMs.
EL
Consequently, the techniques for estimating the peak CPU
PT
and network usage do not apply to memory. The provisioning
component uses observed swap activity to determine if the
N
current memory allocation of the VM should be increased.
EL
estimated even when the resource is fully utilized.
To estimate peak needs, the peak request arrival rate is first
PT
estimated. Since the number of serviced requests as well as
the number of dropped requests are typically logged, the
incoming request rate is the summation of these two
N
quantities.
Given the distribution profile of the arrival rate, the peak rate
is simply a high percentile of the distribution. Let peak
denote the estimated peak arrival rate for the application.
EL
queuing theory result:
PT
where d is the mean response time of requests, s is the mean
N
service time, and cap is the request arrival rate. 2 a and 2 b are
the variance of inter-arrival time and the variance of service
time, respectively. Note that response time includes the full
queueing delay, while service time only reflects the time spent
actively processing a request.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Estimating peak CPU needs:
While the desired response time d is specified by the SLA, the
service time s of requests as well as the variance of inter-arrival
and service times 2 a and 2 b can be determined from the
server logs. By substituting these values into equation, a lower
bound on request rate cap that can be serviced by the virtual
EL
server is obtained.
Thus, cap represents the current capacity of the VM. To service
PT
the estimated peak workload peak , the current CPU capacity
needs to be scaled by the factor peak / cap
N
Observe that this factor will be greater than 1 if the peak arrival
rate exceeds the currently provisioned capacity. Thus, if the VM
is currently assigned a CPU weight w, its allocated share needs to
be scaled up by the factor peak / cap to service the peak
workload.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Estimating peak network needs:
EL
The mean requested file size b; this is the amount of data
PT
transferred over the network to service the peak workload.
The mean request size can be computed from the server
logs.
N
EL
PT
N
EL
Stage 1: Reservation A request is issued to migrate an OS from
host A to host B. We initially confirm that the necessary
PT
resources are available on B and reserve a VM container of that
size. Failure to secure resources here means that the VM simply
N
continues to run on A unaffected.
EL
resumed in case of failure.
PT
Stage 4: Commitment Host B indicates to A that it has successfully
received a consistent OS image. Host A acknowledges this message as
commitment of the migration transaction: host A may now discard
N
the original VM, and host B becomes the primary host.
EL
transferred) is important, since Xen’s live migration
mechanism works by iteratively copying the memory image of
the VM to the destination while keeping track of which pages
PT
are being dirtied and need to be resent. This requires Xen to
intercept all memory accesses for the migrating domain,
N
which significantly impacts the performance of the
application inside the VM.
By reducing the amount of data copied over the network, It
can minimize the total migration time, and thus, the
performance impact on applications.
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Determining Placement – Where to?
Migrate VMs from overloaded to underloaded servers
net
Volume = 1 1 1
* *
1-cpu 1-net 1-mem
EL
Use Volume to find most loaded servers cpu
Captures load on multiple resource dimensions
PT
Highly loaded servers are targeted first
EL
Don’t create new hotspots! Migration
What if high average load in system?
Swap if necessary
PT
Swap a high Volume VM for a low Volume one
Spare
N
Requires 3 migrations PM1 PM2
• Can’t support both at once
VM1
Swaps increase the number VM2 VM5
of hotspots we can resolve VM3 VM4
Swap
Cloud Computing and DistributedVuSystems
Pham Hotspot Mitigation for VM Migration
Reading
USENIX NSDI ‘07
EL
Source: https://www.usenix.org/legacy/event/nsdi07/tech/full_papers/wood/wood.pdf
Source: https://www.usenix.org/legacy/event/nsdi05/tech/full_papers/clark/clark.pdf
EL
and eliminate hotspots while treating each VM as a black-box.
scenarios PT
Gray-Box information can improve performance in some