Rohit Handa
Lecturer, CSE-IT Department
IBM-ICE Program, BUEST Baddi
Topic-Load Balancing, Machine Imaging
Overloading
People put load on your web site by making lots of requests to it. If the load is too high
(because too many people are visiting), your web site is going to take a performance
hit. Its going to slow down, and with more and more users, it will get slower and
slower until it fails completely.
To get around this, you need more resources. You can either buy a bigger machine to
replace your current server (scale up) or you can buy another small machine to work
alongside your existing server (scale out).
Working of Processor
1. Keeping the database server alive and watching for requests.
2. Taking requests for data from the database.
3. Calling up the database and looking through it for each specific piece of information to
match your query
4. Making changes to the existing database tables (if applicable) for the query that it has
received.
5. Altering the data collected for the query into one cohesive response in the format you
requested, even if it is the default format.
6. Packaging and transferring the collated response to the portion of the system that
requested it.
7. Tracking that this request has been made, by whom, how it went, and what Happened.
Overprovisioning
Overprovisioning means allocating more resources and (normally) more virtual
machines that your host has available to it.
All that space that is not being used at any one given moment when combined form a
significant volume of resources, and all of them when combined are enough to power
several virtual machines.
This is what you call overprovisioning, adding more servers than you have provisioned
for, because you know that you will have spare extra capacity to use with these
servers.
Load Balancing
Load Balancing means the ability to spread the load of processing over a number of
separate systems for an overall performance increase in processing incoming requests.
Er. Rohit Handa
Lecturer, CSE-IT Department
IBM-ICE Program, BUEST Baddi
Load balancing is a computer networking method for distributing workloads across
multiple computing resources, such as computers, a computer cluster, network links,
central processing units or disk drives.
It represents the ability to transfer any portion of the processing for a system request
to another independent system that will handle it concurrently. Eg. Web/Database
Server.
One characteristic of cloud computing is virtualized network access to a service. No
matter where you access the service, you are directed to the available resources. The
technology used to distribute service requests to resources is referred to as load
balancing.
Load balancing Load balancing is an optimization technique which can be
implemented in hardware or in software.
Using multiple components with load balancing instead of a single component may
increase reliability through redundancy.
Without load balancing, cloud computing would very difficult to manage. Load
balancing provides the necessary redundancy to make an intrinsically unreliable
system reliable through managed redirection.
It also provides fault tolerance when coupled with a failover mechanism.
Load balancing is nearly always a feature of server farms and computer clusters and
for high availability applications.
A load-balancing system can use different mechanisms to assign service direction.
In the simplest load-balancing mechanisms, the load balancer listens to a network
port for service requests. When a request from a client or service requester arrives, the
load balancer uses a scheduling algorithm to assign where the request is sent.
Typical scheduling algorithms in use today are round robin and weighted round robin,
fastest response time, least connections and weighted least connections, and custom
assignments based on other factors.
A session ticket is created by the load balancer so that subsequent related traffic from
the client that is part of that session can be properly routed to the same resource.
Er. Rohit Handa
Lecturer, CSE-IT Department
IBM-ICE Program, BUEST Baddi
Without this session record or persistence, a load balancer would not be able to
correctly failover a request from one resource to another.
Persistence can be enforced using session data stored in a database and replicated
across multiple load balancers.
Other methods can use the client's browser to store a client-side cookie or through the
use of a rewrite engine that modifies the URL.
Of all these methods, a session cookie stored on the client has the least amount of
overhead for a load balancer because it allows the load balancer an independent
selection of resources.
The algorithm can be based on a simple round robin system where the next system in
a list of systems gets the request. Round robin DNS is a common application, where IP
addresses are assigned out of a pool of available IP addresses.
Porting Applications
Cloud computing applications have the ability to run on virtual systems and for these
systems to be moved as needed to respond to demand.
Systems (VMs running applications), storage, and network assets can all be virtualized
and have sufficient flexibility to give acceptable distributed WAN application
performance.
Developers who write software to run in the cloud will undoubtedly want the ability to
port their applications from one cloud vendor to another, but that is a much more
difficult proposition. Cloud computing is a relatively new area of technology, and the
major vendors have technologies that don't interoperate with one another.
VM Migration
Live migration refers to the process of moving a running virtual machine or
application between different physical machines without disconnecting the client or
application.
Memory, storage, and network connectivity of the virtual machine are transferred from
the original host machine to the destination.
VM memory migration
Two techniques for moving the virtual machine's memory state from the source to the
destination are pre-copy memory migration and post-copy memory migration.
1. Pre-copy memory migration
Er. Rohit Handa
Lecturer, CSE-IT Department
IBM-ICE Program, BUEST Baddi
a. Warm-up phase: In pre-copy memory migration, the Hypervisor typically copies
all the memory pages from source to destination while the VM is still running on
the source. If some memory pages change (become 'dirty') during this process,
they will be re-copied until the rate of re-copied pages is not less than page
dirtying rate.
b. Stop-and-copy phase: After the warm-up phase, the VM will be stopped on the
original host, the remaining dirty pages will be copied to the destination, and the
VM will be resumed on the destination host. The time between stopping the VM
on the original host and resuming it on destination is called "down-time", and
ranges from a few milliseconds to seconds according to the size of memory and
applications running on the VM. There are some techniques to reduce live
migration down-time, such as using probability density function of memory
change.
2. Post-copy memory migration
Post-copy VM migration is initiated by suspending the VM at the source.
With the VM suspended, a minimal subset of the execution state of the VM is
transferred to the target.
The VM is then resumed at the target, even though most of the memory state of the VM
still resides at the source.
At the target, when the VM tries to access pages that have not yet been transferred, it
generates page-faults.
These faults are trapped at the target and redirected towards the source over the
network.
Such faults are referred to as network faults. The source host responds to the network-
fault by sending the faulted page.
Since each page fault of the running VM is redirected towards the source, this
technique can degrade performance of applications running inside the VM.
However, pure demand-paging accompanied with techniques such as pre-paging can
reduce this impact by a great extent.
When down-time of a VM during a live migration is not noticeable by the end user, it is
called a seamless live migration.
Xen Hypervisor
Xen is an open-source type-1 or baremetal hypervisor, which makes it possible to run
many instances of an operating system or indeed different operating systems in
parallel on a single machine (or host).
Xen is the only type-1 hypervisor that is available as open source. Xen is used as the
basis for a number of different commercial and open source applications, such as:
server virtualization, Infrastructure as a Service (IaaS), desktop virtualization, security
applications, embedded and hardware appliances.
The University of Cambridge Computer Laboratory developed the first versions of Xen.
The Xen community develops and maintains Xen as free and open-source software,
subject to the requirements of the GNU General Public License (GPL), version 2.
Er. Rohit Handa
Lecturer, CSE-IT Department
IBM-ICE Program, BUEST Baddi
Xen is currently available for the IA-32, x86-64 and ARM instruction sets.
Xen runs in a more privileged CPU state than any other software on the machine.
It is responsible for CPU scheduling and memory partitioning of the various virtual
machines running on the hardware device.
Xen boots from a boot loader such as GNU GRUB, and then usually loads a
paravirtualized host operating system into the host domain (dom0).
The system administrator can log into dom0 in order to manage any other guest
operating systems, called "domain U" (domU) in Xen terminology.
The device accesses from all the domU are managed through the dom0.
The hypervisor not only
abstracts the hardware
for the virtual machines
but also controls the
execution of virtual
machines as they share
the common processing
environment.
It has no knowledge of
networking, external
storage devices, video,
or any other common
I/O functions found on
a computing system.
Features:
Small footprint and interface (is around 1MB in size). Because Xen uses a
microkernel design, with a small memory footprint and limited interface to the guest, it
is more robust and secure than other hypervisors.
Operating system agnostic: Most installations run with Linux as the main control
stack (aka "domain 0"). But a number of other operating systems can be used instead,
including NetBSD and OpenSolaris.
Driver Isolation: Xen has the capability to allow the main device driver for a system to
run inside of a virtual machine. If the driver crashes, or is compromised, the VM
containing the driver can be rebooted and the driver restarted without affecting the
rest of the system.
Paravirtualization:
Fully paravirtualized guests
have been optimized to run
as a virtual machine. This
allows the guests to run
much faster than with
hardware extensions (HVM).
Additionally, Xen can run on
hardware that doesn't
support virtualization
extensions.
Xen Architecture
Er. Rohit Handa
Lecturer, CSE-IT Department
IBM-ICE Program, BUEST Baddi
Components:
1. The Xen Hypervisor:
It is an exceptionally lean (<150,000 lines of code) software layer that runs directly
on the hardware and is responsible for managing CPU, memory, and interrupts.
It is the first program running after the boot loader exits.
The hypervisor itself has no knowledge of I/O functions such as networking and
storage.
2. Guest Domains/Virtual Machines:
They are virtualized environments, each running their own operating system and
applications.
Xen supports two different virtualization modes:
Paravirtualization (PV) and Hardware-assisted or
Full Virtualization (HVM).
Both guest types can be used at the same time
on a single Xen system.
It is also possible to use techniques used for
Paravirtualization in an HVM guest: essentially
creating a continuum between PV and HVM.
This approach is called PV on HVM.
Xen guests are totally isolated from the
hardware: in other words, they have no privilege
to access hardware or I/O functionality. Thus,
they are also called unprivileged domain (or DomU).
All paravirtualized virtual machines running on a Xen hypervisor are referred to as
Domain U PV Guests and are modified Linux operating systems, Solaris, FreeBSD, and
other UNIX operating systems.
All fully virtualized machines running on a Xen hypervisor are referred to as Domain U
HVM Guests and run standard Windows or any other unchanged operating system.
A Domain U PV Guest contains two drivers for network and disk access, PV Network
Driver and PV Block Driver.
3. The Control Domain (or Domain 0):
It is a specialized Virtual Machine that has special privileges like the capability to
access the hardware directly, handles all access to the systems I/O functions and
interacts with the other Virtual Machines.
It also exposes a control interface to the outside world, through which the system is
controlled.
The Xen hypervisor is not usable without Domain 0, which is the first VM started by
the system.
The dom0 is essentially the "host" operating system or a "service console.
Er. Rohit Handa
Lecturer, CSE-IT Department
IBM-ICE Program, BUEST Baddi
All Xen virtualization environments require
Domain 0 to be running before any other virtual
machines can be started.
Two drivers are included in Domain 0 to support
network and local disk requests from Domain U
Guests:
o The Network Backend Driver
communicates directly with the local
networking hardware to process all virtual
machines requests coming from the
Domain U guests.
o The Block Backend Driver communicates
with the local storage disk to read and
write data from the drive based upon
Domain U requests
4. Toolstack and Console:
Domain 0 contains a control stack (also called Toolstack) that allows a user to manage
virtual machine creation, destruction, and configuration.
The toolstack exposes an interface that is either driven by a command line console, by
a graphical interface or by a cloud orchestration stack such as OpenStack or
CloudStack.
5. Xen-enabled operating systems:
A Xen Domain 0 requires a Xen-enabled kernel.
Paravirtualized guests require a PV-enabled kernel.
Linux distributions that are based on recent Linux kernel are Xen-enabled and usually
contain packages that contain the Xen Hypervisor and Tools Xen.
All but legacy Linux kernels are PV-enabled: in other words, they will run Xen PV
guests.