Final-Report Compress
Final-Report Compress
Final-Report Compress
In this project a new VM load balancing algorithm has been proposed for an
IaaS framework in Simulated cloud computing environment; i.e. „Priority
Weighted Active Monitoring Load Balancing Algorithm‟ using CloudSim tools,
for the Datacenter to effectively load balance requests by prioritizing them and
assigning/allocating them between the available virtual machines assigning a
weight, in order to achieve better performance parameters such as response time
and Data processing time.
Keywords
1
efficient load balancing as cloud is a very complex structure and components are
present throughout a wide spread area. Here some uncertainty is attached while
jobs are assigned. This paper considers some of the methods of load balancing in
large scale Cloud systems. Our aim is to provide an evaluation and comparative
study of these approaches, demonstrating different distributed algorithms for load
balancing and to improve the different performance parameters like throughput,
latency etc. for the clouds of different sizes. As the whole Internet can be viewed
as a cloud of many connection-less and connection-oriented services, thus concept
of load balancing in Wireless sensor networks (WSN) can also be applied to cloud
computing systems as WSN is analogous to a cloud having no. of master
computers (Servers) and no. of slave computers (Clients) joined in a complex
structure.
1.2 MOTIVATION
Cloud computing is a vast concept. Many of the algorithms for load
balancing in cloud computing have been proposed. Some of those algorithms have
been overviewed in this project. The whole Internet can be considered as a cloud of
many connection-less and connection-oriented services. So the divisible load
scheduling theory for Wireless networks can also be applied for clouds. The
performance of various algorithms have been studied.
1.3 OBJECTIVES
1. To study the performance of some of the existing load balancing algorithms.
2
3. To evaluate the performance of the proposed scheme using CloudSim, an
abstract cloud computing environment using java language.
1.4 CONCLUSION
This chapter gives a brief idea about Cloud Computing and load balancing. It also
gives an overall idea about the objectives, motivation and organization of this
report.
3
2 CLOUD COMPUTING
2.1 INTRODUCTION
In case of Cloud computing services can be used from diverse and widespread
resources, rather than remote servers or local machines. There is no standard
definition of Cloud computing. Generally it consists of a bunch of distributed
servers known as masters, providing demanded services and resources to different
clients known as clients in a network with scalability and reliability of datacenter.
The distributed computers provide on-demand services. Services may be of
software resources (e.g. Software as a Service, SaaS) or physical resources (e.g.
Platform as a Service, PaaS) or hardware/infrastructure (e.g. Hardware as a
Service, HaaS or Infrastructure as a Service, IaaS ). Amazon EC2 (Amazon Elastic
Compute Cloud) is an example of cloud computing services.
2.2 CLOUD COMPONENTS
A Cloud system consists of 3 major components such as clients, datacenter, and
distributed servers. Each element has a definite purpose and plays a specific role.
4
2.2.1 Clients
End users interact with the clients to manage information related to the cloud.
Clients generally fall into three categories as given in [1]:
_ Mobile: Windows Mobile Smartphone, smartphones, like a Blackberry, or an
iPhone.
_ Thin: They don‟t do any computation work. They only dispaly the information.
Servers do all the works for them. Thin clients don‟t have any internal memory.
_ Thick: These use different browsers like IE or mozilla Firefox or Google Chrome
to connect to the Internet cloud.
2.2.2 Datacenter
Datacenter is nothing but a collection of servers hosting different applications. A
end user connects to the datacenter to subscribe different applications. A datacenter
may exist at a large distance from the clients. Now-a-days a concept called
virtualisation is used to install a software that allow multiple instances of virtual
server applications.
2.2.3 Distributed Servers
Distributed servers are the parts of a cloud which are present throughout the
Internet hosting different applications. But while using the application from the
cloud, the user will feel that he is using this application from its own machine.
2.3 TYPE OF CLOUDS
Based on the domain or environment in which clouds are used, clouds can be
divided into 3 categories :
_ Public Clouds
_ Private Clouds
_ Hybrid Clouds (combination of both private and public clouds)
5
2.4 VIRTUALIZATION
It is a very useful concept in context of cloud systems. Virtualization means
”something which isn‟t real”, but gives all the facilities of a real. It is the software
implementation of a computer which will execute different programs like a real
machine.
Virtualization is related to cloud, because using virtualization an end user can use
different services of a cloud. The remote datacenter will provide different services
in a fully or partial virtualized manner.
2 types of virtualization are found in case of clouds as given in [1] :
_ Full virtualization
_ Para virtualization
2.4.1 Full Virtualization
In case of full virtualization a complete installation of one machine is done on
another machine. It will result in a virtual machine which will have all the
software‟s that are present in the actual server.
6
2.4.2 Para virtualization
In para vitualization, the hardware allows multiple operating systems to run on
single machine by efficient use of system resources such as memory and processor.
e.g. VMware software. Here all the services are not fully available, rather the
services are provided partially.
7
2.5 SERVICES PROVIDED BY CLOUD COMPUTING
Service means different types of applications provided by different servers across
the cloud. It is generally given as ”as a service”. Services in a cloud are of 3 types
as given in [1] :
Software as a Service (SaaS)
Platform as a Service (PaaS)
Hardware as a Service (HaaS) or Infrastructure as a Service (IaaS)
2.5.1 Software as a Service (SaaS)
In SaaS, the user uses different software applications from different servers
through the Internet. The user uses the software as it is without any change and do
not need to make lots of changes or doen‟t require integration to other systems.
The provider does all the upgrades and patching while keeping the infrastructure
running.
8
Customer resource management (CRM)
Video conferencing
IT service management
Accounting
2.5.2 Platform as a Service (PaaS)
PaaS provides all the resources that are required for building applications
and services completely from the Internet, without downloading or installing a
software. PaaS services are software design, development, testing, deployment,
and hosting. Other services can be team collaboration, database integration, web
service integration, data security, storage and versioning etc.
9
Server space
Network equipment
Memory
CPU cycles
Storage space
10
This section portrays the importance of simulation technique and simulation in
cloud. In this project, simulation is carried out with a specific cloud simulator,
CloudSim [2].
2.6.1 Importance of simulation technique:
Simulation means mimicking the actual environment towards benefit of the
research. The user or researcher can actually analyze the proposed design or
existing algorithms through simulation. They can check the efficiency and merit of
the design before the actual system is constructed.
Simulation is advantageous to the users, as they can explore the benefit of
that design repeatedly. This actually reduces the cost of reconstruct as changes
have been made during design time. Simulation technique provides lots of
advantages as the experiments can be carried out with voluminous data in different
abstraction level. Simulators easily make available various kind of virtual
environment for verification and performance evaluation of the experimented
system. Even most of the time researchers could carry out benchmark experiments
repeatedly in scalable environment for evaluating different aspects.
2.6.2 Cloud Simulator- CloudSim
Users are capable of accessing shared resources through utilizing available
public cloud platform. However, accessing real cloud environment or public cloud
is not always handy. Instead of the real environment, cloud simulator could
facilitate the experiments. Simulation environment allows customers or users to
tune the performance bottlenecks or evaluates different kinds of features under
varying load distributions[2]. Different kinds of functionalities of CloudSim are
presented in the following [3].
• support for modeling and simulation of large scale cloud computing data centers
• support for modeling and simulation of virtualized server hosts, with
customizable policies for provisioning host resources to virtual machines
11
• support for modeling and simulation of energy-aware computational resources
• support for modeling and simulation of datacenter network topologies and
message-passing applications
• support for modeling and simulation of federated clouds
• support for dynamic insertion of simulation elements, stop and resume of
simulation
• support for user-defined policies for allocation of hosts to virtual machines and
policies for allocation of host resources to virtual machines
Besides these above-mentioned functionalities, while developers or researchers,
uses CloudSim features, need not to think about the lower level details of cloud
based infrastructure and services.
The architecture of CloudSim comprises of four layers, as shown in Figure 7.
User code
Simulation Cloud User Application
Specification Scenario Requirements … Configuration
Scheduling
User or Data Center Broker
Policy
CloudSim
User Virtual
Cloudlet
Interface Machine
Structures
VM Cloudlet VM
Services Execution Management
12
At the bottom most layer, cloud resources (hosts, datacenters) are managed.
During the simulation period, these core entities are instantiated and executed. On
top of this layer, cloud services, like allocation of CPU, memory, storage and
bandwidth are provided as dedicated management interfaces. Another two top most
layers are virtual machine services and user interface structures. Virtual machine
in user interface structures layer is responsible for physical host specifications
such as number of machines and their configurations. CloudSim facilitates a
specific host to be concurrently shared among different VMs based on user-defined
QoS specifications [3]. This chapter gives a general idea about the basic concepts
of cloud computing along with the services provided by cloud computing systems.
In addition to that, a brief description of these components and the working
relationship between them is presented in the following:
Datacenter: Datacenter encompasses a number of hosts in homogeneous or
heterogeneous configurations (memory, cores, capacity, and storage). It also
creates the bandwidth, memory, and storage devices allocation.
Virtual Machine (VM): VM characteristics comprise of memory, processor,
storage, and VM scheduling policy. Multiple VM can run on single hosts
simultaneously and maintain processor sharing policies.
Host: This experiment considers VM need to handle a number of cores to be
processed and host should have resource allocation policy to distribute them in
these VMs. So host can arrange sufficient memory and bandwidth to the process
elements to execute them inside VM. Host is also responsible for creation and
destruction of VMs.
Cloudlet: Cloudlet is an application component which is responsible to deliver the
data in the cloud service model. So the length, and output file sizes parameter of
Cloudlet should be greater than or equal to 1. It also contains various ids for data
transfer and application hosting policy.
13
2.6.3 Modeling the Cloud
14
techniques that developers want to implement and perform tests with. Once an
application service is defined and modeled, it is assigned to one or more pre-
instantiated VMs through a service specific allocation policy. Allocation of
application-specific VMs to Hosts in a Cloud-based data center is the responsibility
of a Virtual Machine Allocation controller component (called
VmAllocationPolicy). This component exposes a number of custom methods for
researchers and developers that aid in implementation of new policies based on
optimization goals (user centric, system centric or both). By default,
VmAllocationPolicy implements a straightforward policy that allocates VMs to the
Host in First-Come-First-Serve (FCFS) basis. Hardware requirements such as the
number of processing cores, memory and storage form the basis for such
provisioning. Other policies, including the ones likely to be expressed by Cloud
providers, can also be easily simulated and modeled in CloudSim. However,
policies used by public Cloud providers (Amazon EC2, Microsoft Azure) are not
publicly available, and thus a pre-implemented version of these algorithms is not
provided with CloudSim.
For each Host component, the allocation of processing cores to VMs is done
based on a host allocation policy. This policy takes into account several hardware
characteristics such as number of CPU cores, CPU share, and amount of memory
(physical and secondary) that are allocated to a given VM instance. Hence,
CloudSim supports several simulation scenarios that assign specific CPU cores to
specific VMs (a space-shared policy) or dynamically distribute the capacity of a
core among VMs (time-shared policy); and assign cores to VMs on demand.
(check this sentence).
Each Host component also instantiates a VM scheduler component, which
can either implement the space-shared or the time-shared policy for allocating
cores to VMs. Cloud system/application developers and researchers, can further
15
extend the VM scheduler component for experimenting with custom allocation
policies. In the next section, the finer level details related to the time-shared and
space-shared policies are described. Fundamental software and hardware
configuration parameters related to VMs are defined in the VM class. Currently, it
supports modeling of several VM configurations offered by Cloud providers such
as the Amazon EC2.
16
the host level, it is possible to specify how much of the overall processing power of
each core will be assigned to each VM. At the VM level, the VM assigns a fixed
amount of the available processing power to the individual application services
(task units) that are hosted within its execution engine. For the purpose of this
paper, we consider a task unit as a finer abstraction of an application service being
hosted in the VM.
At each level, CloudSim implements the time-shared and space-shared
provisioning policies. To clearly illustrate the difference between these policies
and their effect on the application service performance, in Figure 4 we show a
simple VM provisioning scenario. In this figure, a host with two CPU cores
receives request for hosting two VMs, such that each one requires two cores and
plans to host four tasks units. More specifically, tasks t1, t2, t3 and t4 to be hosted
in VM1, while t5, t6, t7, and t8 to be hosted in VM2.
(a) (b)
(c) (d)
Figure 9. Effects of different provisioning policies on task unit execution: (a) Space-shared
provisioning for VMs and tasks, (b) Space-shared provisioning for VMs and time-shared
provisioning for tasks, (c) Time-shared provisioning for VMs, space-shared provisioning for
tasks, and (d) Time-shared provisioning for VMs and tasks.
where est(p) is the Cloudlet (cloud task) estimated start time and rl is the total
number of instructions that the Cloudlet will need to execute on a processor. The
estimated start time depends on the position of the Cloudlet in the execution queue,
because the processing unit is used exclusively (space-shared mode) by the
Cloudlet. Cloudlets are put in the queue when there are free processing cores
available that can be assigned to the VM. In this policy, the total capacity of a host
having np processing elements is given by:
𝑛𝑝 𝑐𝑎𝑝(𝑖)
capacity=∑𝑖=1
𝑛𝑝
where eft(p) is the estimated finish time, ct is the current simulation time, and
cores(p) is the number of cores (processing elements) required by the Cloudlet. In
18
time-shared mode, multiple Cloudlets (task units) can simultaneously multi-task
within a VM. In this case, we compute the total processing capacity of Cloud host
as
𝑛𝑝
∑ 𝑐𝑎𝑝(𝑖)
capacity= 𝑖=1
𝑐𝑙𝑜𝑢𝑑𝑙𝑒𝑡𝑠 𝑐𝑜𝑟𝑒𝑠(j),𝑛𝑝)
max(∑j=1
In Figure 9(c), a time-shared provisioning is used for VMs, while task units
are provisioned based on a space-shared policy. In this case, each VM receives a
time slice on each processing core, which then distributes the slices among task
units on a space-shared basis. As the cores are shared, the amount of processing
power available to a VM is variable. This is determined calculating VMs that are
active on a host. As the task units are assigned based on a space-shared policy,
which means that at any given instance of time only one task can be actively using
the processing core.
Finally, in Figure 9(d) a time-shared allocation is applied for both VMs and
task units. Hence, the processing power is concurrently shared by the VMs and the
shares of each VM are simultaneously divided among its task units. In this case,
there are no queuing delays associated with task units.
CONCLUSION:
In this chapter the basics of Cloud computing, virtualization, simulation
techniques and a java based cloud simulator CloudSim was discussed. The way in
which CloudSim models the cloud and Virtual Machines and different policies for
scheduling is studied.
19
3 LOAD BALANCING
3.1 INTRODUCTION
It is a process of reassigning the total load to the individual nodes of the
collective system to make resource utilization effective and to improve the
response time of the job, simultaneously removing a condition in which some of
the nodes are over loaded while some others are under loaded. A load balancing
algorithm which is dynamic in nature does not consider the previous state or
behavior of the system, that is, it depends on the present behavior of the system.
The important things to consider while developing such algorithm are:
estimation of load,
comparison of load,
stability of different system,
performance of system,
interaction between the nodes,
nature of work to be transferred,
selecting of nodes and many other ones.
This load considered can be in terms of CPU load, amount of memory used, delay
or Network load.
Load balancing in cloud computing is the process of distributing the load among
various resources in any system. Thus load need to be distributed over the
resources in cloud-based architecture, so that each resources does approximately
the equal amount of task at any point of time. Basic need is to provide some
techniques to balance requests to provide the solution of the application faster.
20
Cloud vendors are based on automatic load balancing services, which allow clients
to increase the number of CPUs or memories for their resources to scale with
increased demands. This service is optional and depends on the clients business
needs. So load balancing serves two important needs, primarily to promote
availability of Cloud resources and secondarily to promote performance.
21
There are also other load balancing mechanisms like
Centralized load balancing
De-centralized load balancing
Periodic load balancing
Non-Periodic load balancing.
3.4 GOALS OF LOAD BALANCING ALGORITHMS:
Cost effectiveness: primary aim is to achieve an overall improvement in
system performance at a reasonable cost.
Scalability and flexibility: the distributed system in which the algorithm is
implemented may change in size or topology. So the algorithm must be
scalable and flexible enough to allow such changes to be handled easily.
Priority: prioritization of the resources or jobs need to be done on before
hand through the algorithm itself for better service to the important or high
prioritized jobs in spite of equal service provision for all the jobs regardless
of their origin.
3.5 CONCLUSION
This chapter explains the concept of load balancing, types of load balancing
algorithms, general idea about load balancing algorithms and the different policies
that can be used in it.
22
4. VIRTUALIZATION
4.1 INTRODUCTION TO VIRTUALIZATION:
The virtualization forms the foundation of cloud technology where
Virtualization is an emerging IT paradigm that separates computing functions and
technology implementations from physical hardware. Cloud computing, for
example, is the Virtualization of computer programs through an internet
connection rather than installing applications on every office computer.
Using virtualization, users can access servers or storage without knowing specific
server or storage details. The virtualization layer will execute user request for
computing resources by accessing appropriate resources.
Virtualization can be applied to many types of computer resources:
Infrastructure such as Storage, Network, Compute (CPU / Memory etc.), Platform
(such as Linux/ Windows OS) and Software as Services.
Cloud computing in computing research and industry today has the potential
to make the new idea of „computing as a utility‟ in the near future. The Internet is
often represented as a cloud and the term “Cloud Computing”. Cloud computing is
the dynamic provisioning of IT capabilities/IT services (hardware, software, or
services) from third parties over a network. These IT services are delivered on
demand and they are delivered elastically, in terms of „able to scale out‟ and „scale
in‟. The sections below briefly details different types of cloud computing and how
Virtual Machines (VMs) can be provided as cloud Infrastructure as a Service(Iaas).
23
creation, execution, management, and hosting environment for application
services.
The modeled VMs in the above virtual environment are contextually isolated
but still they need to share computing resources- processing cores, system bus etc.
Hence, the amount of hardware resources available to each VM is constrained by
the total processing power ie. CPU, the memory and system bandwidth available
within the host. The choice of virtual machine, meaning that you can select a
configuration of CPU, memory, storage, bandwidth etc. that is optimal for an
application.
CloudSim supports VM provisioning at two levels:-
At the host level – It is possible to specify how much of the overall
processing power of each core will be assigned to each VM. Known as VM
policy Allocation
At the VM level – the VM assigns a fixed amount of the available
processing power to the individual application services (task units) that are
hosted within its execution engine. Known as VM Scheduling.
Note that at each level CloudSim implements the time-shared and space-shared
provisioning policies. In this project, we have implemented the VM load Balancing
algorithm at the VM level and a comparison is made between time-shared and
space-shared provisioning policies, where, individual application services is
assigned varying (different) amount of the available processing power of VMs
based on priority of task units. This is because- in the real world, it‟s not necessary
all the VMs in a DataCenter has fixed amount of processing powers but it can vary
with different computing nodes at different ends.
And then to these VMs of different processing powers, the tasks/requests
(application services) based on priority are assigned or allocated to the most
24
powerful VM and then to the lowest and so on. Hence, the performance parameters
such as overall response time and data processing time are optimized.
4.3 SOME LOAD BALANCING ALGORITHMS:
Brief reviews of few existing load balancing algorithms are presented in the
following:
4.3.1 Token Routing:
The main objective of the algorithm is to minimize the system cost by
moving the tokens around the system. But in a scalable cloud system agents cannot
have the enough information of distributing the work load due to communication
bottleneck. So the workload distribution among the agents is not fixed. The
drawback of the token routing algorithm can be removed with the help of heuristic
approach of token based load balancing. This algorithm provides the fast and
efficient routing decision. In this algorithm agent does not need to have an idea of
the complete knowledge of their global state and neighbor‟s working load. To
make their decision where to pass the token they actually build their own
knowledge base. This knowledge base is actually derived from the previously
received tokens. So in this approach no communication overhead is generated.
4.3.2. Round Robin:
In round robin algorithm, the processes are divided between all processors.
Each process is assigned to the processor in a round robin order. The process
allocation order is maintained locally independent of the allocations from remote
processors. Though the work load distributions between processors are equal but
the job processing time for different processes are not same. So at any point of
time some nodes may be heavily loaded and others remain idle. This algorithm is
mostly used in web servers where Http requests are of similar nature and
distributed equally.
25
4.3.3. Randomized:
Randomized algorithm is of type static in nature. In this algorithm a process
can be handled by a particular node n with a probability p. The process allocation
order is maintained for each processor independent of allocation from remote
processor. This algorithm works well in case of processes are of equal loaded.
However, problem arises when loads are of different computational complexities.
Randomized algorithm does not maintain deterministic approach. It works well
when Round Robin algorithm generates overhead for process queue.
4.3.4. Central queuing:
Central queuing algorithm works on the principal of dynamic distribution.
Each new activity arriving at the queue manager is inserted into the queue. When
request for an activity is received by the queue manager it removes the first activity
from the queue and sends it to the requester. If no ready activity is present in the
queue the request is buffered, until a new activity is available. But in case new
activity comes to the queue while there are unanswered requests in the queue the
first such request is removed from the queue and new activity is assigned to it.
When a processor load falls under the threshold then the local load manager sends
a request for the new activity to the central load manager. The central manager
then answers the request if ready activity is found otherwise queues the request
until new activity arrives.
4.3.5. Connection mechanism:
Load balancing algorithm can also be based on least connection mechanism
which is a part of dynamic scheduling algorithm. It needs to count the number of
connections for each server dynamically to estimate the load. The load balancer
records the connection number of each server. The number of connection
increases when a new connection is dispatched to it, and decreases the number
when connection finishes or timeout happens.
26
Table 1 presents a comparative study of the above-mentioned load balancing
algorithms:
27
• Resource Utilization - is used to check the utilization of resources. It should be
optimized for an efficient load balancing.
• Scalability - is the ability of an algorithm to perform load balancing for a system
with any finite number of nodes. This metric should be improved.
• Response Time - is the amount of time taken to respond by a particular load
balancing algorithm in a distributed system. This parameter should be minimized.
• Fault Tolerance - is the ability of an algorithm to perform uniform load balancing
in spite of arbitrary node or link failure. The load balancing should be a good
fault-tolerant technique.
• Migration time - is the time to migrate the jobs or resources from one node to
other. It should be minimized in order to enhance the performance of the system.
• Energy Consumption (EC) - determines the energy consumption of all the
resources in the system. Load balancing helps in avoiding overheating by
balancing the workload across all the nodes of a Cloud, hence reducing energy
consumption.
• Carbon Emission (CE) - calculates the carbon emission of all the resources in the
system. As energy consumption and carbon emission go hand in hand, the more the
energy consumed, higher is the carbon footprint. So, for an energy-efficient load
balancing solution, it should be reduced.
The major issue in this allocation is this that it does not consider the
advanced load balancing requirements such as processing times for each individual
requests.
29
Fig 10: Round Robin Load Balancer
30
identified is selected. ActiveVmLoadBalancer returns the VM id to the Data
Center Controller. The data Center Controller sends the request to the VM
identified by that id. DataCenterController notifies the ActiveVmLoadBalancer of
the new allocation and cloudlet is sent to it.
4.5 CONCLUSION
This chapter focuses on virtualization, an overview of virtual machines and
how CloudSim supports Load balancing algorithms. Contemporary load balancing
algorithms are also introduced to get a clear idea about the proposed system.
31
5. PROPOSED SYSTEM
5.1 INTRODUCTION
The „Priority Weighted Load Balancing Algorithm‟ is implemented;
modifying the Active Monitoring Load Balancer by assigning a weight to each VM
as discussed in Weighted Round Robin Algorithm of cloud computing and
providing priority to requests in order to achieve better response time and
processing time. In this proposed Load balancing algorithm using the concept of
weights in active monitoring, the VM are assigned varying (different) amount of
the available processing power of server/ physical host to the individual application
services and also applying priority to requests provide better performance. To these
VMs of different processing powers; the tasks/requests (application services) are
prioritized and assigned or allocated to the most powerful VM and then to the
lowest and so on according to its weight and its availability. Hence optimizing the
given performance parameters.
(Algorithm)
STEP 1: Create VM‟s of different Datacenter according to computing power of
host/physical server in terms of its core processor, processing speed, memory,
storage etc.
STEP 2: Allocate weighted count according to the computing power of the VM‟s
in Datacenter. If one VM is capable of having twice as much load as the other, the
powerful server gets a weight of „2‟ or if it can take four times load then server
gets a weight of „4‟ and so on.
For example:
A. Host server with single core processor, 1GB of memory, 1TB of Storage space,
1000000 bandwidth will have weighted count=1
32
B. Host server with 2 core processor, 4GB of memory, 2TB of Storage space and
1000000 bandwidth will have weighted count=2
C. Host server with quard core processor, 8GB of memory 4TB of Storage space
and 1000000 bandwidth will have weighted count=4 and so on..
STEP 3: PriorityWeightedActiveVmLoadBalancer maintains an index table of
VMs, associated weighted count and the number of requests currently allocated to
the VM. At start all VM's have 0 allocations.
STEP 4: The requests are prioritized based on the applications from which they
arrive from.
STEP 5: When a request to allocate a new VM from the DataCenterController
arrives, it gets the priority of the request and then parses the table to find the most
powerful VM. If there are more than one, then the one which is least loaded is
selected.
STEP 6: PriorityWeightedActiveVmLoadBalancer returns the VM id to the
DataCenterController.
STEP 7: The DataCenterController sends the request to the VM identified by that
id.
STEP 8: DataCenterController notifies the Priority Weighted Active Vm Load
Balancer of the new allocation.
STEP9: PriorityWeightedActiveVmLoadBalancer updates the allocation table
increasing the allocations count for that VM.
STEP 10: When the VM finishes processing the request, and the
DataCenterController receives the response cloudlet, it notifies the
PriorityWeightedActiveVmLoadBalancer of the VM de-allocation.
STEP 11:The Priority Weighted Active Vm Load Balancer updates the allocation
table by decreasing the allocation count for the VM by one.
STEP 12: Continue from step 5.
33
The purpose of algorithm is to find the expected Response Time of each Virtual
Machine because virtual machine are of heterogeneous capacity with regard to its
processing performance, the expected response time can be found with the help of
the following formulas:
Response Time = Fint - Arrt + TDelay (1)
Where, Arrt is the arrival time of user request and Fint is the finish time of user
request and the transmission delay can be determined by using the following
formulas:
TDelay = T + T(2)latencytransfer
Where, TDelay is the transmission delay Tlatency is the network latency and T
transfer is the time taken to transfer the size of data of a single request (D) from
source location to destination.
Ttransfer = D / Bwperuser (3)
Bwperuser = Bwtotal / Nr (4)
Where, Bwtotal is the total available bandwidth and Nr is the number of user
requests currently in transmission. The Internet Characteristics also keeps track of
the number of user requests in-flight between two regions for the value of Nr.
5.3 CONCLUSION
In this chapter, our new algorithm for load balancing has been proposed. The
various formulas to calculate response time, delay and processing time are defined.
34
6. PROPOSED EXECUTION ENVIRONMENT
6.1 INTRODUCTION
This chapter discusses about implementing the proposed environment in
CloudSim, a java based cloud simulator. The components of the simulator,
implementation, coding and comparisons will be discussed in the next sections of
this chapter.
6.2 CLASS DIAGRAM OF COMPONENTS OF CLOUDSIM
35
6.3 IMPLEMENTATION
The proposed algorithm is implemented through simulation package
CloudSim based tool [7][10][11]. Java language is used for develop and implement
the new „Priority Weighted VM load balancing Algorithm‟. Assuming that the
applications are deployed in 3 datacenters having 2 virtual machines each running
on 6 physical hosts, then the parameter values are as follows:
Parameter Value
Datacenter OS Linux
Datacenter Architecture X86
Service Broker Policy Optimize response time
Physical hardware units(hosts) 6
No. of VM‟s 6
Table 2 : Datacenter Parameters
The datacenter characteristics of the three datacenters are as follows:
Characteristics Datacenter 1 Datacenter 2 Datacenter 3
Cost* 5.0 3.0 4.0
CostPerMem# 0.5 0.3 0.4
CostPerStorage$ 0.05 0.05 0.04
costPerBw** 0.0 0.0 0.0
Table 3: Datacenter Characteristics
* The cost of using processing in this resource
# The cost of using memory in this resource
$ The cost of using storage in this resource
** The cost of using bw in this resource
36
The detail of the processing element in each host is given below:
No of processors Processor speed(MIPS) VM policy
1 900 Space-shared
2 2000 Space- shared
Table 4: Processing element characteristics
37
// 2. A Machine contains one or more PEs or CPUs/Cores.
List<Pe> peList = new ArrayList<Pe>();
List<Pe> peList1 = new ArrayList<Pe>();
int mips = 1000;
// 3. Create PEs and add these into a list.
peList.add(new Pe(0, new PeProvisionerSimple(900)));
peList1.add(new Pe(0, new PeProvisionerSimple(mips)));
peList1.add(new Pe(1, new PeProvisionerSimple(mips)));
//4. Create Host with its id and list of PEs and add them to the list of machines
int hostId=0;
int ram = 1024*2; //host memory (MB)
long storage = 1000000; //host storage
int bw = 100000;
//in this example, the VMAllocatonPolicy in use is SpaceShared. It means that
//only one VM is allowed to run on each Pe.
hostList.add(
new Host( hostId,
new RamProvisionerSimple(ram),
new BwProvisionerSimple(bw),
storage,
peList,
new VmSchedulerSpaceShared(peList))
); // This is our first machine
hostId++;
hostList.add(
new Host(
hostId,
38
new RamProvisionerSimple(ram),
new BwProvisionerSimple(bw),
storage,
peList1,
new VmSchedulerSpaceShared(peList))
);
39
// 6. Finally, we need to create a PowerDatacenter object.
Datacenter datacenter = null;
try {
if(name == "Datacenter_0")
datacenter = new Datacenter(name, characteristics, new
VmAllocationPolicySimple(hostList), storageList, 0);
else if (name== "Datacenter_1")
datacenter = new Datacenter(name, characteristics1, new
VmAllocationPolicySimple(hostList), storageList, 0);
else
datacenter = new Datacenter(name, characteristics2, new
VmAllocationPolicySimple(hostList), storageList, 0);
}
catch (Exception e) {e.printStackTrace();}
return datacenter;
}
6.4.3 Third step: Create Broker. DatacenterBroker represents a broker acting on
behalf of a user. It hides VM management, as vm creation, sumbission of cloudlets
to this VMs and destruction of VMs.
40
Method to create datacenterBroker
private static DatacenterBroker createBroker(){
41
//create any number of VMs
Vm vm1 = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerSpaceShared());
//the second VM will have twice the priority of VM1 and so will receive twice
//CPU time and so on
vmid++;
Vm vm2 = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new
CloudletSchedulerSpaceShared());
.
.
.
//add the VMs to the vmList
vmlist.add(vm1);
vmlist.add(vm2);
//submit vm list to the broker
broker.submitVmList(vmlist);
6.4.5 Fifth step: Create two CloudletLists. Each list can contain any number of
cloudlets of different lengths. Submit the lists to the broker.
cloudletList1 = new ArrayList<Cloudlet>();
cloudletList2 = new ArrayList<Cloudlet>();
cloudletList1 = createCloudlet(brokerId, 10, 0); // creating 10 cloudlets
cloudletList2 = createCloudlet1(brokerId, 10, 0); // creating 10 cloudlets
//submit cloudlet list to the broker
broker.submitCloudletList(cloudletList1);
broker.submitCloudletList(cloudletList2)
42
METHOD TO CREATE CLOUDLETS FOR LIST1
private static List<Cloudlet> createCloudlet(int userId, int cloudlets, int idShift){
// Creates a container to store Cloudlets
LinkedList<Cloudlet> list1 = new LinkedList<Cloudlet>();
//cloudlet parameters
long length = 40000;
long fileSize = 300;
long outputSize = 300;
int pesNumber = 1;
UtilizationModel utilizationModel = new UtilizationModelFull();
Cloudlet[] cloudlet = new Cloudlet[cloudlets];
for(int i=0;i<cloudlets;i++){
cloudlet[i] = new Cloudlet(idShift + i, length, pesNumber, fileSize,
outputSize, utilizationModel, utilizationModel, utilizationModel);
// setting the owner of these Cloudlets
cloudlet[i].setUserId(userId);
list1.add(cloudlet[i]);
length+=1000;
}
return list1;
}
43
METHOD TO CREATE CLOUDLETS FOR LIST2
private static List<Cloudlet> createCloudlet1(int userId, int cloudlets, int idShift){
// Creates a container to store Cloudlets
LinkedList<Cloudlet> list2 = new LinkedList<Cloudlet>();
//cloudlet parameters
long length = 35000;
long fileSize = 300;
long outputSize = 300;
int pesNumber = 1;
UtilizationModel utilizationModel = new UtilizationModelFull();
Cloudlet[] cloudlet = new Cloudlet[cloudlets];
for(int i=0;i<cloudlets;i++){
cloudlet[i] = new Cloudlet(idShift + i, length, pesNumber, fileSize, outputSize,
utilizationModel, utilizationModel, utilizationModel);
// setting the owner of these Cloudlets
cloudlet[i].setUserId(userId);
list2.add(cloudlet[i]);
length+=2000;
}
return list2;
}
6.4.6 Submitting cloudlets to the broker: Cloudlets are submitted to the broker
priority wise. This way, the broker will submit the bound cloudlets only to the
specific VM.
Cloudlet cloudletx;
cloudletx = cloudletList2.get(j);
if(cloudletx.getCloudletLength()<46000)
broker.bindCloudletToVm(cloudletx.getCloudletId(),vm1.getId());
else
broker.bindCloudletToVm(cloudletx.getCloudletId(),vm2.getId());
45
6.4.7 Sixth step: Start simulation
CloudSim.startSimulation();
6.4.8 Final step: Print results when simulation is over
List<Cloudlet> newList = broker.getCloudletReceivedList();
CloudSim.stopSimulation();
printCloudletList(newList);
//Print the debt of each user to each datacenter
datacenter0.printDebts();
datacenter1.printDebts();
datacenter2.printDebts();
6.5 CONCLUSION
Thus the proposed algorithm is implemented using cloudsim. The results
of the implementation is discussed in the next chapter.
46
7. IMPLEMENTATION RESULTS
7.1 INTRODUCTION:
The results of implementation are divided into 3 categories,
Processing cost
Response Time
Average Response Time.
7.2 PROCESSING COST:
The processing cost of the whole algorithm depends on the data center debts.
Datacenter debts of the existing system and proposed system are compared in the
following table and a chart is drawn.
Datacenter Existing System Debts Proposed System Debts
1 10256 10512
2 10256 10307.2
3 10256 8409.6
AVERAGE 10256 9742.933
Table 5: Comparison of Processing cost
12000
10000
8000
6000
Debt(Exis)
4000
Debt(Prop)
2000
0
1
2
3
47
10300
10200
10100
10000
9900 Series1
9800
9700
9600
9500
9400
Av. Debt(Exis) Av. Debt(Prop)
48
1400
1200
1000
800
time(exis)
600 time(prop)
400
200
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
482.189 262.7445
500
450
400
350
300
Series1
250
200
150
100
50
0
Existing system Proposed System
49
7.5 CONCLUSION
Thus the proposed system „priority weighted active monitoring load
balancer‟ is found to be efficient in terms of Processing cost, response time and
average response time.
Load balancing is becoming an area of increased interest and with the
proposed algorithm we have optimized processing time and cost.
50
REFERENCES
[1] Anthony T.Velte, Toby J.Velte, Robert Elsenpeter, Cloud Computing A
Practical Approach, TATA McGRAW-HILL Edition 2010.
[3] Calheiros Rodrigo N., Rajiv Ranjan, César A. F. De Rose, Rajkumar Buyya
(2009): CloudSim: A Novel Framework for Modeling and Simulation of Cloud
Computing Infrastructures and Services CoRR abs/0903.2525: (2009)
[6] Rajkumar Buyya, Rajiv Ranjan and Rodrigo N. Calheiros,; Modeling and
Simulation of Scalable Cloud Computing Environments and the CloudSim Toolkit:
Challenges and Opportunities. Proceedings of the 7th High Performance
51
Computing and Simulation Conference (HPCS 2009, ISBN: 978-1-4244-4907-1,
IEEE Press, New York, USA), Leipzig, Germany, June 21-24, 2009.
52