<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Load Balancing to Save Energy in Cloud Computing</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Theodore Pertsas</string-name>
          <email>tpertsas@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Manchester United</institution>
          <country>Kingdom</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>- While load balancing techniques have been designed and evaluated for efficient resource utilization in cloud computing, achieving energy efficiency as a consequence of load balancing often does not get direct attention. In this paper we describe two load balancing algorithms that focus on balancing workload distribution among physical hosts in the cloud infrastructure. The test results presented in this paper reveal the strength and weaknesses of the algorithms. In future work we aim to analyze the impact of our load balancing on energy consumption in the cloud infrastructure.</p>
      </abstract>
      <kwd-group>
        <kwd>energy efficiency</kwd>
        <kwd>load balancing</kwd>
        <kwd>cloud</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>Cloud computing offers a scalable and economical solution
for addressing rapidly increasing computational needs of ICT
applications. Increasing popularity and widespread adaptation
of cloud computing is resulting in continual growth in terms of
numbers and size of cloud facilities, raising questions about
effective management of workloads as well as long term
environmental implication of cloud computing model. In fact,
management of cloud applications with the view to achieve
energy efficiency is now being considered a critical challenges
to be dealt with in cloud computing.</p>
      <p>
        Existing techniques for achieving energy efficiency in
cloud computing focus on strategic power management
operations e.g. by suggesting the use of low powered machines
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and deploying applications on fewer machines or spreading
them evenly across available resources/machines [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
Typically, such techniques are applied at the initial deployment
stage i.e. while deploying new applications on cloud. In the
work presented in this paper we address the load balancing and
energy efficiency issues at post-deployment stage. Particularly,
we focus on load balancing as a way to ensure effective and
efficient utilization of cloud resources and consequently to find
alternative deployment configurations that can contribute
towards saving energy in the cloud infrastructure.
      </p>
      <p>The two load balancing algorithms we describe in this
paper aim to minimize wastage of cloud resources as a result of
under-utilization of some resources; and minimize lengthy
response times as a result of over-utilization, where both cases
contribute towards excess energy consumption. We adopt an
agent-based system development approach for the
© Copying permitted only for private and academic purposes.
This volume is published and copyrighted by its editors</p>
      <p>This section describes the preliminaries concerning the
cloud infrastructure and load balancing algorithms.</p>
      <p>Task is an application component which is either executed
or stored in a virtual machine (VM) with specific CPU,
memory and disk space. A cloud application can have several
tasks each running on a VM.</p>
      <p>Host is a physical server capable of hosting several VMs.</p>
      <p>Load can be considered to be a number of tasks which
currently exist at a host</p>
      <p>As tasks arrive at a host, the load of the host is increasing.
Due to the heterogeneity of the system tasks can be completed
at different time intervals and therefore some hosts will be
more loaded than the others at any given time. Thus load
balancing, as the name implies, is a method to distribute the
load to the hosts in the system.</p>
      <p>A load balancing algorithm needs to consider various
factors in order to decide if the system needs balancing and
how to perform it. Depending on how these decisions are
taken, where they are taken, how they are performed and what
additional benefit is being sought (e.g. energy efficiency in our
perspective), we can identify different types of heuristics and
policies for load balancing.</p>
      <p>Before we delve into more technical details about our load
balancing algorithms it is worth noting our reasons for its
importance:
 Reduces overloading of certain resources e.g. hosts
 Energy efficiency by virtue of minimizing the overall
execution time of tasks in cloud infrastructure
 Maximises the amount of work done by the cloud
infrastructure (throughput).</p>
      <p>In a cloud infrastructure, we assume that tasks can be
migrated between hosts and new tasks can arrive at any host at
any time. In a cloud infrastructure, there can be N number of
hosts, which form the set H. Each host , has a load at
any time . The load depends on the used CPU, memory,
disk capacity, etc. of the host. Denoting the set of
values for CPU, memory, capacity, any other quantity that
affects the load of a host, we define the load function
, for each host i.</p>
      <p>
        Following the utility-based optimization approach [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] the
utility of each task is defined as the inverse of its load. Hence,
we define the utility function for a host i as
      </p>
      <p>The utility function is a metric for the load of a host.
Depending on the load balancing heuristic, we need to
minimise or maximise . Below we denote the system utility
function, which represents the overall optimisation problem at
the system level. We are trying to find solutions that will end
up minimizing over time.</p>
    </sec>
    <sec id="sec-2">
      <title>III. SYSTEM DESIGN</title>
      <p>Here we describe the design features of the different
modules which contribute towards the design of a system that
allow us to implement and test our load balancing algorithms
and give a solution that is applicable in cloud computing.</p>
      <sec id="sec-2-1">
        <title>A. Tasks</title>
        <p>A task is executed at the host and has certain requirements.
In our system each new task has certain characteristics or
structure, as shown in Figure 1.
host supports this type. Otherwise, it remains in the waiting list
of the host.</p>
      </sec>
      <sec id="sec-2-2">
        <title>B. Host</title>
        <p>A host is a central entity in the cloud infrastructure and is
the place where the load balancing happens in our system.</p>
        <p>Each host is represented by an agent that runs individually
from other host agents in the cloud infrastructure. The internal
structure of a host agent is composed of five components, the
network component, the processor, the task manager, the
logger and the load balancer as shown Figure 2.</p>
        <p>Network Component: each host agent is able to interact
with other host agents by sending and receiving messages in a
reliable manner. In this respect, a host agent acts as both a
server and a client. As a server, it runs continuously in the
background, in order to accept messages and tasks.</p>
        <p>Processor: The component that represents the running tasks
in a host is the processor component. In this respect, the
processor is responsible for creating or setting up the VMs
where tasks can be deployed and executed. The processor starts
the creation of VMs and subsequently execution of tasks by
picking them from a waiting list, which is basically a
temporary storage space in the host agent where new task
(request) arrives. New tasks wait in the waiting list until their
required resources are allocated (e.g. a VM is setup).</p>
        <p>Task Manager: The task manager is the component of host
agent that is responsible for receiving and analysing new tasks,
and loading tasks from waiting list to the processor.</p>
        <p>Logger: The logger component (as shown in Figure 3)
receives messages from the load balancer about the state of the
host and any requests that are received from other hosts. The
logger can log messages, as list of events, either locally or
receive messages from other hosts in the cloud infrastructure.
Each task has a certain type and can only be executed if the</p>
        <p>Load Balancer: The most important and decision making
entity in the host agent is the load balancer. Depending on the
algorithm that will be used, the decisions for the load balancing
operation will be taken here. The load balancer is able to
communicate with the processor, in order to get latest load
information. It will use the network component to send
messages to other hosts. The network component will pass any
received messages to the load balancer for evaluation. If a task
is received, then the load balancer uses the task manager to
check the task details/structure. The load balancer has an
address book that holds the addresses of other host agents in
the system. The decision making about load balancing
operation is based on the notion of state transitions. In this
respect, each host agent, can be in one of the following states at
any time:
A host agent can determine the state by checking its current
load (in the Processor component) against the
thresholds in a local statistical
table. The following table shows the relation between the
thresholds and the states.</p>
        <p>Each host agent determines its state independently from the
others and takes the appropriate action depending on the load
balancing algorithm.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>IV. LOAD BALANCING</title>
      <p>Here we describe two algorithms for load balancing and
energy efficiency. The algorithms are based on heuristics and
their main focus is to achieve efficient utilization of available
resources and consequently lower the energy consumption,
while having a minimal overhead in the system.</p>
      <sec id="sec-3-1">
        <title>A. Secretaries</title>
        <p>This heuristic is inspired by the swarm intelligence
approaches and the reality of an office environment. For
example, in a company, when a manager wants a task done, he
delegates it to a secretary. The secretary in her part, makes a
couple of phone calls, or goes around the office, and finds a
suitable person to execute the task. If we imagine a situation, in
which there is more than one secretary, then we can have the
necessary background for a swarm intelligence approach. Each
one of the secretaries will perform their quest, independently of
the others and once they find a candidate they either pass-over
their task, or move to the next candidate. The manager in our
system is the host in which the task arrives, and the candidates
are the other hosts in the network.</p>
        <p>This algorithm is triggered when a host reaches the high
threshold, which sets the host in high load state. Before we start
the discussion on the load balancing algorithm, we need to set
the following policies for host agents:
a) Transfer policy: We use a preset ‘High’ threshold value,
above which the host agent triggers the load balancing
operation. The host agent starts looking for candidate host
agents to send tasks. If a host is below this value, then it
may be able to receive more tasks.
b) Selection policy: Host agents follow a two-step process to
choose tasks to send. In the first step, tasks are selected
based on type e.g. small, medium or large VM instances.
On the second step, hosts randomly choose from the set of
tasks of the same type. We receive tasks of the type that
we can execute in the respective hosts.
c) Location policy: Host agents can send requests to all the
hosts in their address book and then wait for an answer. If
more than two answers are received at the same time, then
the hosts choose randomly from the two. Host agents wait
for a period of time before they resend any requests, to
avoid flooding the network with unnecessary messages.
d) Information policy: Host agents follow a demand-driven
approach, since the requests are sent only when there is
change in state of the host agent.</p>
        <sec id="sec-3-1-1">
          <title>Algorithm 1: Secretaries (Stage 1)</title>
          <p>Initialise a statistics table
while cancellation has not been requested do
get host waiting list load
store the values in the statistics table
if the statistics table has adequate size then
calculate average waiting list size
determine the state of the host
if the state is High then</p>
          <p>Decide number and type of tasks to send out</p>
          <p>Send load balancing request to hosts in the
address book</p>
          <p>If the algorithm decides that the host has high load, then it
proceeds to ask for help. The “ask for help” operation will be
referred as Load Balancing Request (LBR). As mentioned
before, a host is in high state when it is over the high threshold.
In this algorithm, host agents follow the strategy that they need
to send as many tasks as they can to other hosts, in order to fall
under the high threshold. In this case, this will happen when the
hosts send the excessive items of the waiting list.</p>
          <p>Once a host agent sends the LBR, the next stage happens in
the load balancing algorithm of the host agent that receives it.</p>
        </sec>
        <sec id="sec-3-1-2">
          <title>Algorithm 2: Secretaries (Stage 2)</title>
          <p>Check host state
if host state is not High or High Average then</p>
          <p>Check if the types of tasks (within LBR) can be
executed on this host
if they can be executed then</p>
          <p>Decide number of tasks to ask for</p>
          <p>Accept the LBR and send the number of tasks
back to the sender
else</p>
          <p>Forward the LBR to host agents in the address book
The receiver host agent, checks its status looking at the
local statistics table. If the state is Low or Low Average, then it
can accept the LBR. The host agent asks for as many tasks as it
is needed to reach the High threshold, or just over it, thus
setting its state at High Average or High. The main criterion for
this to happen is the local queue size, because this determines
the size of the batch. After receiving the tasks, the host agent
can still accept more tasks until an acceptable state is reached.</p>
          <p>Once the host accepts the LBR message, it sends back to
the initial host agent the number of tasks that it can receive, in
order to help the initial sender/requester host agent. This leads
us to the third and last stage of the algorithm.</p>
        </sec>
        <sec id="sec-3-1-3">
          <title>Algorithm 3: Secretaries (Stage 3)</title>
          <p>if suitable candidate was found after sending LBR then
Stop load balancing
Pick up the desired number of tasks from the
waiting list</p>
          <p>Send tasks</p>
          <p>Once a suitable candidate is found that is willing to accept
excess load of the initial requester (host agent), the first step at
this stage is to stop the load balancer. The final number of tasks
to send out is the maximum number that the other host agent
can accept. The next step is to pick up the tasks that will be
sent out. To perform this step we choose the tasks randomly
without adding further complexity to the algorithm.</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>B. Eager Worker</title>
        <p>This algorithm is inspired by the epidemic protocols; a
relatively new approach to load balancing by spreading
information around the system in a similar way that a virus (or
gossip) spreads. In this scenario, the central role is played by a
worker who does not have any work to do. However, since he
is eager to work, he goes to all the people that he knows and
announces his availability (“infects”). Since he cannot do
anything else, he waits for someone to call him. The people
who know this fact now have the option to either use him, or
spread the rumor around that there is an available worker
(“spread the infection”). In our case, worker is a host agent
who goes under the average threshold and is in either Low
Average or Low state. The algorithm has following policies:
a) Transfer policy: Host agents use the Average threshold
value in order to trigger the load balancing operation.</p>
        <p>Below this value the hosts will be able to receive tasks.
b) Selection policy: This policy is the same as in the
“Secretaries” algorithm.
c) Location policy: Host agents are selected for sending a
load balancing request. After sending the requests, the
sender host agent waits for a reply. Requests are sent in
an interval, to avoid flooding the system. If a request for
help arrives from two or more host agents, then host
agents operate in a “first-come, first-served” manner.
d) Information policy: Host agents follow a demand-driven
policy. The requests are sent, when the host is in Low or
Low Average state.</p>
        <p>This algorithm follows a more opportunistic model: if there
is help, the host agent will make use of it without considering
the overall state of the system.</p>
        <p>The algorithm has a two-stage execution, contrary to the
three stages in “Secretaries” algorithm. At the first stage a host
agent determines the state of the host and then sends the LBRs.
Algorithm 4 includes the pseudo-code for this stage.</p>
        <sec id="sec-3-2-1">
          <title>Algorithm 4: Eager Worker (Stage 1)</title>
          <p>Initialise a statistics table
while cancellation has not been requested do
get host waiting list load
store the values in the statistics table
if the statistics table has adequate size then
calculate average waiting list size
determine the state of the host
if the state is Low or Low Average then</p>
          <p>Decide number and type of tasks to send
Send load balancing request to host agents in
the address book</p>
          <p>Most of the steps in this algorithm are similar to the
“Secretaries” algorithm. When deciding for the number of tasks
and types to send, we base our calculations on the waiting list
of hosts, since this is what determines the amount of tasks to
delegate. The host agents in this algorithm ask for as many
tasks as needed, in order to remain under the High threshold.</p>
          <p>When the number and types of tasks to ask is decided, a
LBR is sent to either a random number of host agents in the
address book or to all of them. If the LBR is sent to all of them
then this might lead to an overflow of messages in the system.
Since this algorithm follows an epidemic approach, the LBRs
will reach to all the host agents in the system..</p>
        </sec>
        <sec id="sec-3-2-2">
          <title>Algorithm 5: Eager Worker (Stage 2)</title>
          <p>if load balancing request was received then</p>
          <p>Check host state
If host state is High or High Average then</p>
          <p>Check if the sender host agent can execute the
tasks of this host
if they can be executed then</p>
          <p>Stop load balancing
Decide number of tasks to send and choose
tasks
Accept the LBR and send the tasks</p>
          <p>Start load balancing
else</p>
          <p>Forward LBR to host agents in the address book
The next stage of the algorithm is executed by the host
agent that receives the request.</p>
          <p>This time the host agent accepts the LBR if its state is in
High Average or High. The High Average state is included as
well, because the host agent at this stage needs tasks to finish
execution. Since the algorithm follows an opportunistic model,
if there is an idle worker, then it sends tasks across. The
number of tasks depends on the total size of the waiting list. It
sends either the maximum tasks that can be executed in the
other hosts, or in the case of High Average state, enough tasks
so as to get close to the Average threshold.</p>
          <p>The load balancing operation needs to stop for the same
reasons as before and it is restarted after the host agent finishes
the transfer of tasks.</p>
          <p>The choice of tasks to send follows a similar pattern to the
“Secretaries” algorithm. In this initial design, we decided to
choose the tasks in a random way.</p>
          <p>If there is no need for load balancing, then the LBR is
forwarded to other hosts of the network. If the LBR arrives
back to the original host agent, then it is rejected automatically,
thus, avoiding duplicate requests going through the network.
The algorithms were tested in a single site cloud environment.
The message exchanges between host agents happen in a
round-robin format. A host agent “knows” only one other host
agent. The reasoning behind this scenario, compared to
broadcasting or n-to-n interactions, was to minimize the
complexity of managing multi-agent interactions (which was
not the focus of the work presented here) and more importantly
to see if the algorithms develop any behavior. We used
ZeroMQ (http://zeromq.org/) technology to realize message
exchange between host agents. Command messages travel in
one direction starting from one host agent to the last but task
transfer can happen between any two host agents.</p>
          <p>We ran our experiments for each algorithm five times and
we get averages of the number of tasks at each host after an
interval. We create a set of 75 tasks in individual VMs and
deployed them in the first host. Our aim was to observe how
the algorithms handle spikes of load and energy consumption at
a host. Furthermore, we monitored the number of messages
exchanged between the host agents every minute.</p>
          <p>The results of testing both algorithms are shown in Figure
76 and Figure 7.</p>
          <p>For Eager Worker load balancer, Table 1 shows the
average messages per minute circulating in the network.
60
32,8
On average there were around 33 LBR messages every minute
since a number of host agents with low or low-average states
were asking for tasks.
Total transferred tasks
LBRs per minute
Messages per minute
49
0,5
191</p>
          <p>For Secretaries load balancer, the first host agent sends a
LBR every time it needed load balancing – as shown in Table
12, hence the very low number of LBRs in the network.</p>
          <p>As shown in Figure 6, it is obvious that Eager Worker
achieves a better overall performance at the expense of
increased network traffic. The load is distributed uniformly
among the nodes. In particular, Host B did not get as many
tasks due to the preset MaxRetransmits value that restricts host
agents to transmit only 5 messages during the testing period.</p>
          <p>Whereas, in the case of secretaries algorithm, as shown in
Figure 7, Host A was 7 hops away from Host H, hence its LBR
messages never arrived that far. Due to the design of the
algorithm, LBRs are always trying to find overloaded hosts.</p>
          <p>Overall, Eager worker generates approximately 28% more
traffic than Secretaries, but converges faster to an overall load
balanced state. On the other hand, Secretaries tend to form
“neighbourhoods” e.g. host agent A visits first its closest
neighbor and gives them work to do and then slowly spreads its
load to the rest. For this reason the further hosts seldom receive
any tasks. Even if there were more tasks, Host H would have
never been reached due to the preset MaxRetransmits value.
Removing the MaxRestransmits constraint or increasing its
preset value may allow spreading the tasks to further hosts.</p>
          <p>However, the advantage of secretaries algorithm is lower
network traffic: LBRs are sent only when it is needed. On the
other hand, due to the formation of neighborhoods and slower
distribution of load, the execution finished almost 2 minutes
later than Eager Worker.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>VI. SUMMARY AND FUTURE WORK</title>
      <p>This paper presents two heuristics-based algorithms for
load balancing. The results of testing both algorithms reveal
their advantages and disadvantages as one might be performing
better than the other in any given context. By tweaking the
various parameters, we can achieve better performance, but
there is always a trade-off. The work presented in this paper
focuses on testing the load balancing aspect of the algorithm. In
future work, we aim to analyze the impact of these algorithms
on the energy consumption of cloud infrastructure within the
context of ECO2Clouds project (www.eco2clouds.eu).</p>
      <p>ECO2Clouds allows quantification of energy consumption
and environmental impact (CO2 emissions) at three different
levels of cloud infrastructure. These include testbed, physical
host and VM levels. The ability to quantify the energy
consumption at testbed and physical host level will allow us to
investigate the use of our load balancing heuristics as runtime
adaptation mechanisms that can balance resource utilization
with reduction in energy consumption.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>G.</given-names>
            <surname>Luigi Valentini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Lassonde</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. U.</given-names>
            <surname>Khan</surname>
          </string-name>
          , N MinAllah,
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Madani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Zhang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Ghani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. Kolodziej. H.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. Y</given-names>
            <surname>Zomaya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. Z.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Balaji</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bishnu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Pinel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. E.</given-names>
            <surname>Pecero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. Kliazovich. P.</given-names>
            <surname>Bouvry</surname>
          </string-name>
          .
          <article-title>An overview of energy efficiency techniques in cluster computing systems</article-title>
          .
          <source>In Cluster Computing. March</source>
          <year>2013</year>
          , Volume
          <volume>16</volume>
          , Issue 1, pp
          <fpage>3</fpage>
          -
          <lpage>15</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>P.</given-names>
            <surname>Lindberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Leingang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Lysaker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. U.</given-names>
            <surname>Khan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Li</surname>
          </string-name>
          .
          <article-title>Comparison and analysis of eight scheduling heuristics for the optimization of energy consumption and makespan in large-scale distributed system</article-title>
          .
          <source>In Journal of Supercomputing. January</source>
          <year>2012</year>
          ,
          <source>Volu. 59. Issue 1</source>
          , pp.
          <fpage>323</fpage>
          -
          <lpage>360</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>L.</given-names>
            <surname>Skorin-Kapov</surname>
          </string-name>
          , et al.,
          <article-title>"Approaches for Utility-Based QoE-Driven Optimization of Network Resource Allocation for Multimedia Services," in Data Traffic Monitoring and Analysis</article-title>
          . vol.
          <volume>7754</volume>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Biersack</surname>
          </string-name>
          , et al., Eds., ed: Springer Berlin Heidelberg,
          <year>2013</year>
          , pp.
          <fpage>337</fpage>
          -
          <lpage>358</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>