SlideShare una empresa de Scribd logo
1 de 7
Descargar para leer sin conexión
Client-side Load Balancer using Cloud

                                  Sewook Wee                                                            Huan Liu
                      Accenture Technology Labs                                             Accenture Technology Labs
                 50 W. San Fernando Street, Suite 1200                                 50 W. San Fernando Street, Suite 1200
                       San Jose, California, USA                                             San Jose, California, USA
                    sewook.wee@accenture.com                                                 huan.liu@accenture.com


ABSTRACT                                                                            for the potential peak, thus wasting valuable capital, or pro-
Web applications’ traffic demand fluctuates widely and un-                             vision for the normal load, but not able to handle peak when
predictably. The common practice of provisioning a fixed                             it does materialize. Using the elastic provisioning capability
capacity would either result in unsatisfied customers (un-                           of a cloud, a web application can ideally provision its infras-
derprovision) or waste valuable capital investment (overpro-                        tructure tracking the load in real time and pay only for the
vision). By leveraging an infrastructure cloud’s on-demand,                         capacity needed to serve the real application demand.
pay-per-use capabilities, we finally can match the capacity                             Due to the large infrastructure capacity a cloud provides,
with the demand in real time. This paper investigates how                           there is a common myth that an application can scale up
we can build a large-scale web server farm in the cloud. Our                        unlimitedly and automatically when application demand in-
performance study shows that using existing cloud compo-                            creases. In reality, our study shows that scaling an appli-
nents and optimization techniques, we cannot achieve high                           cation in a cloud is more difficult, because a cloud is very
scalability. Instead, we propose a client-side load balanc-                         different from a traditional enterprise infrastructure in at
ing architecture, which can scale and handle failure on a                           least several respects.
milli-second time scale. We experimentally show that our                               First, in enterprises, application owners can choose an op-
architecture achieves high throughput in a cloud environ-                           timal infrastructure for their applications amongst various
ment while meeting QoS requirements.                                                options from various vendors. In comparison, a cloud infras-
                                                                                    tructure is owned and maintained by the cloud providers.
                                                                                    Because of their commodity business model, they only of-
1. INTRODUCTION                                                                     fer a limited set of infrastructure components. For example,
   An infrastructure cloud, such as Amazon’s EC2/S3 ser-                            Amazon EC2 only offers 5 types of virtual servers and ap-
vices [2], promises to fundamentally change the economics                           plication owners cannot customize the specification of them.
of computing. First, it provides a practically unlimited in-                           Second, again due to its commodity business model, a
frastructure capacity (e.g., computing servers, storage or                          cloud typically only provides commodity Virtual Machines
network) on demand. Instead of grossly over-provisioning                            (VM). The computation power and the network bandwidth
upfront due to uncertain demands, users can elastically pro-                        is typically less than high-end servers. For example, all Ama-
vision their infrastructure resources from the provider’s pool                      zon VMs are capable of at most transmitting at roughly
only when needed. Second, the pay-per-use model allows                              800Mbps, whereas, commercial web servers routinely have
users to pay for the actual consumption instead of for the                          several Network Interface Cards (NIC), each capable of at
peak capacity. Third, a cloud infrastructure is much larger                         least 1Gbps. The commodity VMs require us to use hori-
than most enterprise data centers. The economy of scale,                            zontal scaling to increase the system capacity.
both in terms of hardware procurement and infrastructure                               Third, unlike in an enterprise, application owners have lit-
management and maintenance, helps to drive down the in-                             tle or no control of the underlying cloud infrastructure. For
frastructure cost further.                                                          example, for security reasons, Amazon EC2 disabled many
   These characteristics make cloud an attractive infrastruc-                       networking layer features, such as ARP, promiscuous mode,
ture solution especially for web applications due to their                          IP spoofing, and IP multicast. Application owners have no
variable loads. Because web applications could have a dra-                          ability to change these infrastructure features. Many per-
matic difference between their peak load (such as during                             formance optimization techniques rely on the infrastructure
flash crowd) and their normal load, a traditional infrastruc-                        choice and control. For example, to scale a web application,
ture is ill-suited for them. We either grossly over-provision                       application owners either ask for a hardware load balancer
                                                                                    or ask for the ability to assign the same IP address to all
                                                                                    web servers to achieve load balancing. Unfortunately, nei-
                                                                                    ther option is available in Amazon EC2.
Permission to make digital or hard copies of all or part of this work for              Last, commodity machines are likely to fail more frequently.
personal or classroom use is granted without fee provided that copies are           Any architecture design based on cloud must handle machine
not made or distributed for profit or commercial advantage and that copies           failures quickly, ideally in a few milli-seconds or faster, in or-
bear this notice and the full citation on the first page. To copy otherwise, to      der not to frequently disrupt service.
republish, to post on servers or to redistribute to lists, requires prior specific
permission and/or a fee.
                                                                                       Because of these characteristics, cloud-hosted web appli-
SAC’10 March 22-26, 2010, Sierre, Switzerland.                                      cations tend to run on a cluster with many standard com-
Copyright 2010 ACM 978-1-60558-638-0/10/03 ...$10.00.
modity web servers, thus requiring a scalable and agile load       balancer. For example, in our test [11], we found that an
balancing solution. In this study, we propose a client-side        Amazon EC2 instance can handle at most 400 Mbps com-
load balancing architecture that not only leverages the strength   bined ingress and egress traffic.
of existing cloud components, but also overcomes the limi-            Even though some cloud platforms, such as Google App
tations posed above. More specifically, we present the fol-         Engine [7], implicitly offer a hardware-based load balancer,
lowing contributions.                                              we cannot easily get around their limitations because of the
                                                                   limited control we have. In our test, Google App Engine is
  1. Propose client-side load balancing architecture:              only able to handle 10 Mbps in/out or less traffic because of
     Differing from previous proposals on client-side load          its quota mechanism.
     balancing, our proposal is built on insights gained from         HTTP protocol [6] has a built-in HTTP redirect capa-
     our performance studies of cloud components. We               bility, which can instruct the client to send the request to
     leverage the strength of a cloud component (S3’s scal-        another location instead of returning the requested page.
     ability) to avoid any single point of scalability bottle-     Using HTTP redirect, a front-end server can load balance
     neck.                                                         traffic to a number of back-end servers. However, just like
                                                                   a software load balancer, a single point of failure and scala-
  2. A practical implementation:            Previous imple-        bility bottleneck still exist.
     mentations are not transparent to end users. We use
     JavaScript technology to handle all load-balancing de-
     tails behind the scene. From a user’s perspective, he is
     not able to distinguish a web site using client-side load     2.2 DNS Load Balancing
     balancing from a normal web site. We use JavaScript              Another well established technique is DNS aliasing [10].
     to get around current browsers’ cross-domain security         When a user browses to a domain (e.g., www.website.com),
     limitations.                                                  the browser first asks its local DNS server for the IP address
                                                                   (e.g., 209.8.231.11), then, the browser contacts the IP ad-
  3. Realistic evaluation: We evaluate the proposed ar-            dress. In case the local DNS server does not have the IP
     chitecture using a realistic benchmark suite–SPECweb-         address information for the asked domain, it contacts other
     2005 [14]. Our evaluation shows that our proposed             DNS servers that have the information, which will eventu-
     architecture can indeed scale linearly as demand in-          ally be the original DNS server that the web server farm
     creases.                                                      directly manages. The original DNS server can hand out
                                                                   different IP addresses to different requesting DNS servers so
  In the rest of the paper, we show the limitations of cloud       that the load could be distributed out among the servers
to host a web presence using the standard techniques. We           sitting at each IP address.
then describe our client-side load balancing architecture and         DNS load balancing has its drawbacks–load balancing gran-
implementation. Last, we present the evaluation results.           ularity and adaptiveness–that are not specific to the cloud.
                                                                   First, it does a poor job in balancing the load. For per-
2. PRIOR WORK                                                      formance reasons, a local DNS server caches the IP address
                                                                   information. Thus, all browsers contacting the same DNS
  There are well established techniques to scale a web server
                                                                   server would get the same IP address. Since the DNS server
farm in an owned infrastructure. We will briefly visit them
                                                                   could be responsible for a large number of hosts, the load
here and point out their limitations if deployed in cloud.
                                                                   could not be effectively smoothed out.
                                                                      Second, the local DNS server caches IP address for a set
                                                                   period of time, e.g., for days. Until the cache expires, the
2.1   Load Balancer                                                local DNS server guides requests from browsers to the same
   A standard way to scale web applications is by using a          web server. When traffic fluctuates at a time scale much
hardware-based load balancer [5]. The load balancer as-            smaller than days, tweaking DNS server settings has little
sumes the IP address of the web application, so all com-           effect. Traditionally, this drawback have not been as pro-
munication with the web application hits the load balancer         nounced because the number of back-end web servers and
first. The load balancer is connected to one or more iden-          their IP addresses are static anyway. However, it seriously
tical web servers in the back-end. Depending on the user           affects the scalability of a cloud-based web server farm. A
session and the load on each web server, the load balancer         cloud-based web server farm elastically changes the num-
forwards packets to different web servers for processing. The       ber of web servers tracking the volume of traffic in minutes
hardware-based load balancer is designed to handle high-           granularity. Days of DNS caching dramatically reduces this
level of load, so it can easily scale.                             elasticity. More specifically, even though the web server farm
   However, a hardware-based load balancer uses applica-           increases the number of web servers to serve the peak load,
tion specific hardware-based components, thus it is typically       IP addresses for new web servers will not be propagated to
expensive. Because of cloud’s commodity business model,            DNS servers that already have a cached IP address. There-
a hardware-based load balancer is rarely offered by cloud           fore, the requests relying on those DNS servers will keep be-
providers as a service. Instead, one has to use a software-        ing sent to the old web servers which overloads them while
based load balancer running on a generic server.                   the new web servers remain idle. In addition, when a web
   A software-based load balancer [8, 12, 1] is not a scalable     server fails, the DNS entry could not be immediately up-
solution, though. The scalability is usually limited by the        dated. While the DNS changes propagate, users are not
CPU and network bandwidth capacity of the generic server           able to access the service even though there are other live
that the load balancer runs on, and a generic server’s ca-         web servers.
pacity is much smaller than that of a hardware-based load
2.3    Layer 2 Optimization                                         3.1 Cloud Components’ Performance Charac-
   In an enterprise where one can fully control the infras-             teristics
tructure, we can apply layer 2 optimization techniques to              We have run an extensive set of performance tests on a
build a scalable web server farm that does not impose all           number of cloud components to understand their perfor-
drawbacks discussed above: expensive hardware, single per-          mance limits. The results are reported in a technical re-
formance bottleneck, and lack of adaptiveness.                      port [11] and they are not reproduced here due to space
   There are several variations of layer 2 optimization. One        limitations (we do not cite it to facilitate double-blind re-
way, referred to as direct web server return [4], is to have        view). A few key observations from the performance study
a set of web servers, all have the same IP address, but dif-        motivated our design. They are listed as follows:
ferent layer 2 addresses (MAC address). A browser request
may first hit one web server, which may in turn load balance            • When used as a web server, a cloud virtual machine has
the request to other web servers. However, when replying                 a much smaller capacity than a dedicated web server.
to a browser request, any web server can directly reply. By              For example, in our test, an m1.small Amazon instance
removing the constraint that all replies have to go through              is only able to handle roughly 1000 SPECweb2005 [14]
the same server, we can achieve higher scalability. This tech-           sessions. In contrast, as reported on SPECweb2005
nique requires the ability to dynamically change the map-                website, a dedicated web server can handle up to 11,000
ping between an IP address and a layer 2 address at the                  sessions.
router level.
   Another variation, TCP handoff [9], works in a slightly
different way. A browser first establishes a TCP connection              • When used as a software load balancer, a cloud vir-
with a front-end dispatcher. Before any data transfer occurs,            tual machine has an even more limited capability. For
the dispatcher transfers the TCP state to one of the back-               example, because of traffic relaying, any Amazon in-
end servers, which takes over the communication with the                 stances can only handle 400Mbps client traffic, half
client. This technique again requires the ability for the back-          of what the network interface can support (800Mbps).
end servers to masquerade the dispatcher’s IP address.                   Similarly, we found Google App Engine cannot sup-
   Unfortunately, this ability could open doors for security             port high traffic when used as a load balancer. Thus, a
exploits. For example, one can intercept all packets target-             different mechanism is needed in order to scale higher.
ing for a host by launching another host with the same IP
address. Because of the security concerns, Amazon EC2 dis-             • Amazon S3 is designed for static content distribution.
ables all layer 2 capabilities so that any layer 2 technique to          It has built in a high-degree of scalability. In our tests,
scale an application will not work in Amazon cloud.                      it can sustain at least 16Gbps throughput. However,
                                                                         S3 can only host static files; it has no ability to run
                                                                         any server side processing such as JSP, CGI, or PHP.
2.4    Client Load Balancing
   The concept of client side load balancing is not new [3].        3.2 Overview and Originality
One existing approach, the earlier version of NetScape, re-            We present a new web server farm architecture: client-side
quires modification to the browser. Given the diversity of           load balancing. With this architecture, a browser decides on
web browsers available today, it is difficult to make sure that       a web server that it will communicate with amongst available
the visitors to a web site have the required modification.           back-end web servers in the farm. The decision is based on
Smart Client [18], developed as part of the WebOS project           the information that lists the web server IP addresses and
[15][16], requires Java Applets to perform load balancing at        their individual loads.
the client. Unfortunately, it has several drawbacks. First,            The new architecture gets around limitations posed by
Java Applets require the Java Virtual Machine, which is not         cloud components, and achieves a high degree of scalabil-
available by default on most browsers. This is especially true      ity with infrastructure components currently available from
in the mobile environment. Second, if the user accidentally         cloud providers.
agrees, a Java Applet could have full access to the client ma-         Compared to a software load balancer, our architecture
chine, leaving open a big security vulnerability. Third, many       has no single point of scalability bottleneck. Instead, the
organizations only allow administrators to install software,        browser decides on the back-end web server from the list
so users cannot view applets by default. Fourth, a Java Ap-         of servers and communication flows directly between the
plet is an application; the HTML page navigation structure          browser and the chosen back-end web server. Compared to
is lost if navigating within the applet. Last, Smart Client         DNS aliasing technique, our architecture has a finer load
still relies on a central server to download the Java Applet        balancing granularity and adaptiveness. Because client’s
and the server list, which still presents a single point of fail-   browser makes the decision, we can distribute traffic in ses-
ure and scalability bottleneck.                                     sion granularity. Moreover, changes in web server list due to
                                                                    auto-scaling or failures can be quickly propagated to browsers
                                                                    (in milli-seconds) so that the clients would not experience
                                                                    extended congestion or outage. This is because the server
3.    NEW ARCHITECTURE                                              information is not cached in days but rather it is updated
  Since traditional techniques for designing a scalable web         whenever a session is created. We achieve high scalability
server farm would not work in a cloud environment, we need          without requiring sophisticated control on the infrastructure
to devise new techniques which leverage scalable cloud com-         as layer 2 optimization does. Instead, IP addresses of web
ponents while getting around their limitations.                     servers and their individual load information are sufficient.
the probability of choosing any one is inversely pro-
                                                                        portional to its relative load. The weighted random
                                                                        distribution algorithm is designed to avoid all client
                                                                        browsers flash to the same web server at the same time,
                                                                        as a deterministic algorithm would do.
                                                                     2. JavaScript sends a request to a proxy on the target web
                                                                        server. The proxy is currently implemented as another
                                                                        PHP web server running on the same machine but at
                                                                        a different port. The JavaScript sends over two pieces
                                                                        of information encoded as URL parameters. First, it
                                                                        sends the browser cookie associated with the site (doc-
                                                                        ument.cookie). Second, it sends the URL path (loca-
                                                                        tion.pathname).
                                                                     3. The proxy uses the cookie and URL path to re-construct
                                                                        a new HTTP request; and sends the request to the ac-
                                                                        tual web server.

Figure 1: Browser, S3 and web server interaction in                  4. The web server processes the request; invokes dynamic
our client-side load balancing architecture                             script processor such as CGI, PHP, or JSP, as neces-
                                                                        sary; and returns the result back to the proxy.
                                                                     5. The proxy wraps around the result in a JavaScript.
3.3    Implementation                                                6. The client browser executes the returned JavaScript
  Our performance study showed that, being a purposely                  from the proxy; updates the page display; and updates
designed platform, S3 has a high degree of scalability when             the cookies if a set-cookie header has been returned.
delivering static content. This is not surprising. In order
to serve millions of customers, S3 has adopted a distributed         An example of anchor page is shown below. It simply
implementation that can easily scale. However, S3 is not           includes two JavaScript sections along with an empty “To-
suitable as a web hosting platform because modern web sites        BeReplaced” tag which will be replaced later with the real
have to deal with both static and dynamic contents. Amazon         page content.
S3 does not support dynamic content processing, such as
CGI, PHP, or JSP.                                                  <html>
  In our architecture, we use back-end web servers for dy-         <head><title></title>
namic content processing, and use client-side load balancing       <script type="text/javascript">
technique to distribute the traffic across the back-end web          <!--
servers. We host the client-side logic (written in JavaScript)     // the load balancing logic
as well as the list of web servers and their load information in   </script>
S3 in order to avoid a single point of scalability bottleneck.     <script type="text/javascript">
  The detailed architecture is shown in Figure 1. For each         // the server list and load
dynamic page, we create an anchor static page. This anchor         // information in JavaScript
page includes two parts. The first part contains the list of        // variables
web servers’ IP addresses and their individual load (such as       </script></head>
CPU, memory, network bandwidth, etc.) information. They            <body onLoad="load();">
are stored in a set of JavaScript variables that can be ac-        <span id="ToBeReplaced"> </span>
cessed directly from other JavaScript code. The second part        </body></html>
contains the client-side load balancing logic, again written
                                                                      As described above, the goal of the load balancing logic is
in JavaScript. We need one anchor page for each dynamic
                                                                   to choose a back-end web server based on the load, send the
page in case a user browses to the URL directly, however,
                                                                   client request (cookie along with URL path) to the proxy, re-
the contents of the anchor pages are all the same.
                                                                   ceive the returned JavaScript and update the current HTML
  All anchor pages are hosted in S3 to achieve scalability.
                                                                   page. The JavaScript file returned from the proxy looks like
We use S3’s domain hosting capability, which maps a domain
                                                                   the following.
(by DNS aliasing) to S3. We create a bucket with the same
name as the domain name (e.g., www.website.com). When              function page() {
a user accesses the domain, the request is routed to S3 and            return "<HTML page content>";
S3 uses the host header to determine the bucket from which         }
to retrieve the content.                                           function set-cookie() {
  When a client browser loads an anchor page, the browser              <set cookie if instructed
executes the following steps in JavaScript:                                    by web server>
                                                                   }
  1. Examine the load variables to determine to which web
     server it should send the actual request. The cur-            The load balancing logic calls the page() function to replace
     rent algorithm randomly chooses a web server where            the current page content (the “ToBeReplaced” tag) with the
18
string returned by page(). It also calls the set-cookie() func-




                                                                               aggregate throughput (Gbps)
                                                                                                             16
tion which contains the logic to set the client side cookie if                                               14
                                                                                                             12
the web server has indicated so. The set-cookie() function                                                   10
may be empty if the server does not set any cookie.                                                           8
   Even though JavaScript has the capability to load addi-                                                    6
                                                                                                              4
tional content by using XMLHttpRequest, most browsers                                                         2
would not allow XMLHttpRequest to a different server for                                                       0
security reasons. Since we are making a request to a web                                                          10   20   30    40 50 60 70
                                                                                                                                 num of EC2 instances
                                                                                                                                                        80   90   100

server other than S3, we have to adopt an architecture like
shown above.                                                      Figure 2: Aggregate S3 throughput as a function
   To avoid further round trip delays to fetch the anchor         of the number of EC2 instances who simultaneously
page, we keep the load balancing logic JavaScript in the          query S3.
browser memory. When a user clicks any link on the current
page, the JavaScript intercepts the request, loads the corre-
sponding link from the proxy, and replaces the current page                                                                            Average Latency per
content with the new page. If the web server fails during                                                                              Request (second)
a user session (the proxy is not responding), the JavaScript
                                                                            without CLB                                                0.407
randomly chooses another web server and resends the re-
                                                                            CLB per request                                            0.561
quest. This optimization (saving JavaScript in memory)
                                                                            CLB per session                                            0.483
also ensures that all requests from the same session go to
the same back-end server to make it easy to maintain states
                                                                  Table 1: Average latency per request in seconds.
across requests.
                                                                  SPECweb2005 Banking workload with 1000 simulta-
                                                                  neous sessions was evaluated.
4.   EVALUATION
   In this section, we evaluate the scalability of the new
client-side load balancing architecture described in Section 3.   ber of simultaneous sessions that the web server can handle
We believe that the architecture is scalable because 1) each      while meeting its QoS requirement. For each test, the load
client independently runs the computation to decide the cor-      generator generates a number of simultaneous sessions, as
responding back-end server, and 2) it removes the network         specified by the user, and it collects the response time statis-
bandwidth bottleneck of server-side load balancing.               tics for each session. A test passes if 95 % of the pages re-
   To assess the scalability of the architecture, we use the      turn within TIME TOLERABLE and 99 % of the pages re-
SPECweb2005 benchmark [14], which is designed to simu-            turn within TIME GOOD, where TIME TOLERABLE and
late a real web application. It consists of three workloads:      TIME GOOD are specified by the benchmark and they rep-
banking, support, and ecommerce. As its name suggests,            resent the QoS requirement. To find the maximum number
the banking workload simulates the web server front-end of        of sessions, we have to try a number of choices of the num-
an online banking system. It handles all communications           ber of user sessions until we find one that passes the QoS
through SSL for security reasons and most of the requests         requirement. The traffic generator is hosted in Amazon EC2
and responses are short. If a web server terminates a SSL         since our Labs’ WAN network is not fast enough to support
connection, the session has to be persistence, i.e., all future   high traffic simulation.
requests should be sent to the same web server in order to
be decrypted. On the other hand, the support workload             4.1 Scalability of S3
simulates a product support website where users download             In the client-side load balancing architecture, the system
large files such as documentation files and device drivers. All     that delivers the JavaScript as well as the static content be-
communications are through regular HTTP and the largest           comes a single point of contact for all clients. Therefore, the
file to download is up to 40MB. The ecommerce workload             scalability of the overall architecture relies on the scalability
simulates an E-commerce website where users browse the            of the hosting platform.
site’s inventory (HTTP) and buy items (SSL). Therefore, in           In this section, we assess the scalability of Amazon S3.
terms of workload characteristics, it is a combination of the     Since the SPECweb2005 benchmark dynamically generates
above two. In this study, we focus on the banking workload        the web pages, we cannot evaluate S3 directly using the
because its many short requests and its session persistence       benchmark. Instead, we host a large number of static files
requirement stress a load balancer the most among the three       on S3, and we launch a number of EC2 m1.small instances,
workloads.                                                        each has 10 simultaneous TCP sessions sequentially request-
   The SPECweb2005 benchmark consists of two compo-               ing these files one by one as fast as it is able to. Figure 2
nents: the web application and the traffic generator. The           shows the aggregate throughput as a function of the number
web application implements the backend application logic.         of m1.small instances. As shown in the graph, S3 through-
All pages are dynamically generated and a user can choose         put increases linearly. At 100 instances, we achieved 16 Gbps
from either a PHP implementation or a JSP implementa-             throughput. Since we are accessing S3 from EC2, the latency
tion. The traffic generator generates simulated user sessions       is all below the TIME GOOD and TIME TOLERABLE pa-
to interact with the backend web application, where each          rameters in SPECweb2005.
session simulates an individual browser. The traffic genera-
tor could run on several servers in order to spread out the       4.2 Latency Impact
traffic generating workload.                                          As the client-side load balancing (CLB) architecture re-
   The performance metric for the benchmark is the num-           quires clients to hit S3 to fetch a JavaScript file, it adds
S3    CloudFront                                            Sessions    Latency (sec)
         Comcast network        93ms         45ms                         Single node            1,000           0.407
         Stanford campus        82ms          4ms                         12 node cluster      12,000            0.403
         Work network          237ms        139ms
         EC2                   172ms          4ms                Table 3: Latency comparison: a client-side load bal-
                                                                 ancer adds negligible overhead to per request la-
Table 2: Download latency from several edge loca-                tency
tions

                                                                 EC2 experiences a delay that is on the same order of mag-
an extra round trip delay. Even though the architecture is       nitude as our office network. Therefore, our evaluation in
scalable–maintains reasonable latency per request regardless     EC2 is a realistic lower bound.
of the number of clients–it should keep the extra round trip        The Amazon CloudFront offering enables S3 to be used as
delay short enough to achieve the QoS requirement.               geographically distributed content distribution servers. One
   To evaluate the impact of S3 round trip, we use SPECweb-      can simply enable CloudFront on a bucket by issuing a web
2005 banking workload with 1000 simultaneous sessions in         service API call, and the content is automatically cached in
three different setups: 1) direct communication between a         geographically distributed servers. In Table 2, we also show
client and a web server without a load balancer as a baseline,   the latency from CloudFront. The delay is always signifi-
2) CLB with S3 round trip per every HTTP request as a            cantly smaller than its S3 counterpart. We note that Cloud-
naive implementation, and 3) CLB with S3 round trip only         Front currently has a longer time scale (minutes to create
once per new session, which is the current implementation        a distribution). Since we are aiming at a milli-seconds time
described in Section 3.                                          scale for load balancing and failure recovery, CloudFront is
   As shown in Table 1, S3 round trip adds about 154 milli-      not yet suitable for our client-side load balancing architec-
seconds of delay on average, which contributes 7.7% to the       ture.
TIME GOOD QoS requirement (2 seconds). However, when                The results in Table 1 show that, even using S3 directly
we apply the optimization that makes a S3 round trip only        (instead of CloudFront), the latency added by the additional
when it creates a new session, 1 the extra latency becomes       round trip is acceptable. It is a small fraction of the 8 second
negligible; the latency variation originating from EC2 in-       rule [13]; thus, it is unlikely to impact the user perceived
stances or cloud components’ dynamic performance varia-          performance.
tion is greater than the measured difference.
   Even though we perform the SPECweb test only in EC2,          4.3 Overall Scalability
we believe the latency is not a problem even when accessed          Finally, we assess the overall scalability of client-side load
from outside of Amazon. Unfortunately, we do not have ac-        balancing with the SPECweb2005 banking workload. We
cess to a large number of external servers to perform load       measure the average latency per request both on a single
testing from outside of EC2. Instead, we evaluate the la-        web server without load balancing serving 1,000 simultane-
tency from a small set of external servers.                      ous sessions; and on a cluster with 12 web servers serving
   We measure the time it takes to download the JavaScript       12,000 simultaneous sessions.
file which includes both the load balancing logic and the            Table 3 shows that the cluster sustains roughly the same
server load information. Along with the HTTP header, the         average latency per request as the single web server. During
file is about 1500 bytes. We use Wbox [17] to test the down-      the experiment for the cluster, the 12 web servers experience
load latency.                                                    roughly the same load, suggesting that the load balancing
   We perform the test from the following locations:             algorithm can effectively smooth out the load. Based on
                                                                 S3’s scalability as measured in Section 4.1, we believe that
   • From a home network connected to Comcast’s cable            client-side load balancing can further scale beyond 12,000
     network in Sunnyvale, California.                           sessions, but we stop here because of economic constraints.

   • From our office network located in San Jose. Our traf-        5. CONCLUSIONS
     fic is routed to the Chicago head quarter before it is
     sent to the Internet.                                          A cloud is an attractive infrastructure solution for web
                                                                 applications since it enables web applications to dynamically
   • From a server located on Stanford University campus.        adjust its infrastructure capacity on demand. A scalable
                                                                 load balancer is a key building block to efficiently distribute
   • From within Amazon EC2.                                     a large volume of requests and fully utilize the horizontally
                                                                 scaling infrastructure cloud. However, as we pointed out, it
  Table 2 shows the average latency for 10 runs of down-         is not trivial to implement a scalable load balancer due to
loading the same 1500 bytes anchor file from both S3 and          both the cloud’s commodity business model and the limited
CloudFront – Amazon’s content distribution network.              infrastructure control allowed by cloud providers.
  As expected, our office network experiences the longest             In this study, we propose the Client-side Load Balanc-
delay due to its routing through our Chicago office. The           ing (CLB) architecture using a scalable cloud storage ser-
Comcast network and Stanford campus both experience a            vice such as Amazon S3. Through S3, CLB directly deliv-
much shorter delay. However, it is surprising to note that       ers static contents while allowing a client to choose a cor-
                                                                 responding back-end web server for dynamic contents. A
1                                                                client makes the load balancing decision based on the list
  Based on our measurement, SPECweb2005 banking makes
4.41 requests per session on average.                            of back-end web servers and their load information. CLB
uses JavaScript to implement the load balancing algorithm,
which not only makes the load balancing mechanism trans-
parent to users, but also gets around browsers’ cross-domain
security limitation. Our evaluation shows that the proposed
architecture is scalable while introducing a small latency
overhead.

6.   REFERENCES
 [1] Accoria. Rock web server and load balancer.
     http://www.accoria.com.
 [2] Amazon Web Services. Amazon Web Services (AWS).
     http://aws.amazon.com.
 [3] V. Cardellini, M. Colajanni, and P. S. Yu. Dynamic
     load balancing on web-server systems. IEEE Internet
     Computing, 3(3):28–39, 1999.
 [4] L. Cherkasova. FLEX: Load Balancing and
     Management Strategy for Scalable Web Hosting
     Service. IEEE Symposium on Computers and
     Communications, 0:8, 2000.
 [5] F5 Networks. F5 Networks. http://www.f5.com.
 [6] R. Fielding, J. Gettys, J. Mogul, H. Frystyk,
     L. Masinter, P. Leach, and T. Berners-Lee. Hypertext
     transfer protocol – http/1.1. In IETF RFC 2616, 1999.
 [7] Google Inc. Google App Engine.
     http://code.google.com/appengine/.
 [8] HaProxy. HaProxy load balancer.
     http://haproxy.1wt.eu/.
 [9] G. Hunt, E. Nahum, and J. Tracey. Enabling
     content-based load distribution for scalable services.
     Technical report, 1997.
[10] E. Katz, M. Butler, and R. McGrath. A scalable
     HTTP server: The NCSA prototype. In Proc. First
     International Conference on the World Wide Web,
     Apr. 1994.
[11] H. Liu and S. Wee. Web Server Farm in the Cloud:
     Performance Evaluation and Dynamic Architecture. In
     Proc. of the 1st International Conference on Cloud
     Computing (CloudCom 2009), Dec 2009.
[12] Nginx. Nginx web server and load balancer.
     http://nginx.net/.
[13] Z. Research. The need for speed II.
     http://www.keynote.com/downloads/Zona Need For
     Speed.pdf.
[14] SPEC. SPECweb2005 benchmark.
     http://spec.org/web2005/.
[15] A. Vahdat, T. Anderson, M. Dahlin, E. Belani,
     D. Culler, P. Eastham, and C. Yoshikawa. WebOS:
     Operating System Services for Wide Area
     Applications. In Proc. of the 7th IEEE International
     Symposium on High Performance Distributed
     Computing, pages 52–63, 1998.
[16] A. Vahdat, M. Dahlin, P. Eastham, C. Yoshikawa,
     T. Anderson, and D. Culler. WebOS: Software
     Support for Scalable Web Services. In Proc. the Sixth
     Workshop on Hot Topics in Operating Systems, 1997.
[17] Wbox HTTP testing tool.
     http://www.hping.org/wbox/.
[18] C. Yoshikawa, B. Chun, P. Eastham, A. Vahdat,
     T. Anderson, and D. Culler. Using Smart Clients to
     Build Scalable Services. In Proc. USENIX 1997
     Annual Technical Conference, Jan 1997.

Más contenido relacionado

La actualidad más candente

VMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik ReichVMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik ReichItzik Reich
 
14h00 aws deck-summit2012_sap_on_aws_s_jones_final
14h00   aws deck-summit2012_sap_on_aws_s_jones_final14h00   aws deck-summit2012_sap_on_aws_s_jones_final
14h00 aws deck-summit2012_sap_on_aws_s_jones_finalLuiz Gustavo Santos
 
CloudBees PaaS Presentation at Oakland JUG
CloudBees PaaS Presentation at Oakland JUGCloudBees PaaS Presentation at Oakland JUG
CloudBees PaaS Presentation at Oakland JUGCloudBees
 
Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...
Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...
Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...CloudOps Summit
 
Spring, Java Web Apps to the cloud
Spring, Java Web Apps to the cloudSpring, Java Web Apps to the cloud
Spring, Java Web Apps to the cloudCloudBees
 
Do More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed TechnologiesDo More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed TechnologiesEMC Forum India
 
WSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application ServerWSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application ServerHendrik van Run
 
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use CasesWSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use CasesHendrik van Run
 
Le cloud microsoft - Présentation "fourre-tout" - Base
Le cloud microsoft - Présentation "fourre-tout" - BaseLe cloud microsoft - Présentation "fourre-tout" - Base
Le cloud microsoft - Présentation "fourre-tout" - BaseNicolas Georgeault
 
CA Nimsoft xen desktop monitoring
CA Nimsoft xen desktop monitoring CA Nimsoft xen desktop monitoring
CA Nimsoft xen desktop monitoring CA Nimsoft
 
RunE2E Case Study: SAP BusinessObjects in the AWS Cloud
RunE2E Case Study: SAP BusinessObjects in the AWS CloudRunE2E Case Study: SAP BusinessObjects in the AWS Cloud
RunE2E Case Study: SAP BusinessObjects in the AWS CloudAlex Gramling
 
InterCloud - Cloud based DRP
InterCloud - Cloud based DRPInterCloud - Cloud based DRP
InterCloud - Cloud based DRPPierre Cerou
 
Automating virtual workload mobility with IBM Vmready
Automating virtual workload mobility with IBM VmreadyAutomating virtual workload mobility with IBM Vmready
Automating virtual workload mobility with IBM VmreadyIBM India Smarter Computing
 
13h00 p duff-building-applications-with-aws-final
13h00   p duff-building-applications-with-aws-final13h00   p duff-building-applications-with-aws-final
13h00 p duff-building-applications-with-aws-finalLuiz Gustavo Santos
 
JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...
JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...
JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...0xdaryl
 
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...EMC Forum India
 
Building Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsBuilding Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsPeter Moskovits
 

La actualidad más candente (20)

VMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik ReichVMUG ISRAEL November 2012, EMC session by Itzik Reich
VMUG ISRAEL November 2012, EMC session by Itzik Reich
 
14h00 aws deck-summit2012_sap_on_aws_s_jones_final
14h00   aws deck-summit2012_sap_on_aws_s_jones_final14h00   aws deck-summit2012_sap_on_aws_s_jones_final
14h00 aws deck-summit2012_sap_on_aws_s_jones_final
 
CloudBees PaaS Presentation at Oakland JUG
CloudBees PaaS Presentation at Oakland JUGCloudBees PaaS Presentation at Oakland JUG
CloudBees PaaS Presentation at Oakland JUG
 
Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...
Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...
Cloud architecture and deployment: The Kognitio checklist, Nigel Sanctuary, K...
 
Spring, Java Web Apps to the cloud
Spring, Java Web Apps to the cloudSpring, Java Web Apps to the cloud
Spring, Java Web Apps to the cloud
 
Do More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed TechnologiesDo More with Oracle Environment with Open and Best of breed Technologies
Do More with Oracle Environment with Open and Best of breed Technologies
 
WSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application ServerWSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
WSI33 - Advanced Performance Tactics for IBM WebSphere Application Server
 
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use CasesWSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
WSI35 - WebSphere Extreme Scale Customer Scenarios and Use Cases
 
Le cloud microsoft - Présentation "fourre-tout" - Base
Le cloud microsoft - Présentation "fourre-tout" - BaseLe cloud microsoft - Présentation "fourre-tout" - Base
Le cloud microsoft - Présentation "fourre-tout" - Base
 
CA Nimsoft xen desktop monitoring
CA Nimsoft xen desktop monitoring CA Nimsoft xen desktop monitoring
CA Nimsoft xen desktop monitoring
 
RunE2E Case Study: SAP BusinessObjects in the AWS Cloud
RunE2E Case Study: SAP BusinessObjects in the AWS CloudRunE2E Case Study: SAP BusinessObjects in the AWS Cloud
RunE2E Case Study: SAP BusinessObjects in the AWS Cloud
 
InterCloud - Cloud based DRP
InterCloud - Cloud based DRPInterCloud - Cloud based DRP
InterCloud - Cloud based DRP
 
BlazeDS
BlazeDSBlazeDS
BlazeDS
 
Bca1931 final
Bca1931 finalBca1931 final
Bca1931 final
 
Automating virtual workload mobility with IBM Vmready
Automating virtual workload mobility with IBM VmreadyAutomating virtual workload mobility with IBM Vmready
Automating virtual workload mobility with IBM Vmready
 
13h00 p duff-building-applications-with-aws-final
13h00   p duff-building-applications-with-aws-final13h00   p duff-building-applications-with-aws-final
13h00 p duff-building-applications-with-aws-final
 
JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...
JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...
JavaOne 2013 CON7370: Java Interprocess Communication Challenges in Low-Laten...
 
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
Track 1, Session 3 - intelligent infrastructure for the virtualized world by ...
 
Prodware wa college - marcel meijer
Prodware   wa college - marcel meijerProdware   wa college - marcel meijer
Prodware wa college - marcel meijer
 
Building Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSocketsBuilding Living Web Applications with HTML5 WebSockets
Building Living Web Applications with HTML5 WebSockets
 

Similar a Client side load balancer using cloud

Refactoring Web Services on AWS cloud (PaaS & SaaS)
Refactoring Web Services on AWS cloud (PaaS & SaaS)Refactoring Web Services on AWS cloud (PaaS & SaaS)
Refactoring Web Services on AWS cloud (PaaS & SaaS)IRJET Journal
 
Cloud Computing Presentation
Cloud Computing PresentationCloud Computing Presentation
Cloud Computing PresentationMohammed Kharma
 
Aws cloud best_practices
Aws cloud best_practicesAws cloud best_practices
Aws cloud best_practicesSuruli Kannan
 
Application Architecture for Cloud Computing
Application Architecture for Cloud Computing Application Architecture for Cloud Computing
Application Architecture for Cloud Computing white paper
 
Cloud Computing By Pankaj Sharma
Cloud Computing By Pankaj SharmaCloud Computing By Pankaj Sharma
Cloud Computing By Pankaj SharmaRanjan Kumar
 
50 C o m m u n i C At i o n S o f t h E A C m A P.docx
50    C o m m u n i C At i o n S  o f  t h E  A C m       A P.docx50    C o m m u n i C At i o n S  o f  t h E  A C m       A P.docx
50 C o m m u n i C At i o n S o f t h E A C m A P.docxalinainglis
 
AViewofCloudComputing.ppt
AViewofCloudComputing.pptAViewofCloudComputing.ppt
AViewofCloudComputing.pptMrGopirajanPV
 
A View of Cloud Computing.ppt
A View of Cloud Computing.pptA View of Cloud Computing.ppt
A View of Cloud Computing.pptAriaNasi
 
Hire some ii towards privacy-aware cross-cloud service composition for big da...
Hire some ii towards privacy-aware cross-cloud service composition for big da...Hire some ii towards privacy-aware cross-cloud service composition for big da...
Hire some ii towards privacy-aware cross-cloud service composition for big da...ieeepondy
 
A viewof cloud computing
A viewof cloud computingA viewof cloud computing
A viewof cloud computingpurplesea
 
Introduction To Cloud Computing By Beant Singh Duggal
Introduction To Cloud Computing By Beant Singh DuggalIntroduction To Cloud Computing By Beant Singh Duggal
Introduction To Cloud Computing By Beant Singh DuggalBeantsingh
 
The Hybrid Cloud and Dedicated Servers
The Hybrid Cloud and Dedicated ServersThe Hybrid Cloud and Dedicated Servers
The Hybrid Cloud and Dedicated ServersTD Web Services
 
Karrox introduction to cloud computing
Karrox introduction to cloud computingKarrox introduction to cloud computing
Karrox introduction to cloud computingKarrox Franchise
 
All About Cloud Computing by Callender Creates
All About Cloud Computing by Callender CreatesAll About Cloud Computing by Callender Creates
All About Cloud Computing by Callender CreatesNews UK
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdf
3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdf3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdf
3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdfnipun014p
 
A Study on Replication and Failover Cluster to Maximize System Uptime
A Study on Replication and Failover Cluster to Maximize System UptimeA Study on Replication and Failover Cluster to Maximize System Uptime
A Study on Replication and Failover Cluster to Maximize System UptimeYogeshIJTSRD
 

Similar a Client side load balancer using cloud (20)

Refactoring Web Services on AWS cloud (PaaS & SaaS)
Refactoring Web Services on AWS cloud (PaaS & SaaS)Refactoring Web Services on AWS cloud (PaaS & SaaS)
Refactoring Web Services on AWS cloud (PaaS & SaaS)
 
Cloud Computing Presentation
Cloud Computing PresentationCloud Computing Presentation
Cloud Computing Presentation
 
Aws cloud best_practices
Aws cloud best_practicesAws cloud best_practices
Aws cloud best_practices
 
Application Architecture for Cloud Computing
Application Architecture for Cloud Computing Application Architecture for Cloud Computing
Application Architecture for Cloud Computing
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Cloud Computing By Pankaj Sharma
Cloud Computing By Pankaj SharmaCloud Computing By Pankaj Sharma
Cloud Computing By Pankaj Sharma
 
50 C o m m u n i C At i o n S o f t h E A C m A P.docx
50    C o m m u n i C At i o n S  o f  t h E  A C m       A P.docx50    C o m m u n i C At i o n S  o f  t h E  A C m       A P.docx
50 C o m m u n i C At i o n S o f t h E A C m A P.docx
 
AViewofCloudComputing.ppt
AViewofCloudComputing.pptAViewofCloudComputing.ppt
AViewofCloudComputing.ppt
 
AViewofCloudComputing.ppt
AViewofCloudComputing.pptAViewofCloudComputing.ppt
AViewofCloudComputing.ppt
 
A View of Cloud Computing.ppt
A View of Cloud Computing.pptA View of Cloud Computing.ppt
A View of Cloud Computing.ppt
 
Hire some ii towards privacy-aware cross-cloud service composition for big da...
Hire some ii towards privacy-aware cross-cloud service composition for big da...Hire some ii towards privacy-aware cross-cloud service composition for big da...
Hire some ii towards privacy-aware cross-cloud service composition for big da...
 
A viewof cloud computing
A viewof cloud computingA viewof cloud computing
A viewof cloud computing
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
Introduction To Cloud Computing By Beant Singh Duggal
Introduction To Cloud Computing By Beant Singh DuggalIntroduction To Cloud Computing By Beant Singh Duggal
Introduction To Cloud Computing By Beant Singh Duggal
 
The Hybrid Cloud and Dedicated Servers
The Hybrid Cloud and Dedicated ServersThe Hybrid Cloud and Dedicated Servers
The Hybrid Cloud and Dedicated Servers
 
Karrox introduction to cloud computing
Karrox introduction to cloud computingKarrox introduction to cloud computing
Karrox introduction to cloud computing
 
All About Cloud Computing by Callender Creates
All About Cloud Computing by Callender CreatesAll About Cloud Computing by Callender Creates
All About Cloud Computing by Callender Creates
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdf
3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdf3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdf
3.IaabbhjbjbhjbbjbbjbhjhhbbjbhbjhbbjS.pdf
 
A Study on Replication and Failover Cluster to Maximize System Uptime
A Study on Replication and Failover Cluster to Maximize System UptimeA Study on Replication and Failover Cluster to Maximize System Uptime
A Study on Replication and Failover Cluster to Maximize System Uptime
 

Último

4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 

Último (20)

YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 

Client side load balancer using cloud

  • 1. Client-side Load Balancer using Cloud Sewook Wee Huan Liu Accenture Technology Labs Accenture Technology Labs 50 W. San Fernando Street, Suite 1200 50 W. San Fernando Street, Suite 1200 San Jose, California, USA San Jose, California, USA sewook.wee@accenture.com huan.liu@accenture.com ABSTRACT for the potential peak, thus wasting valuable capital, or pro- Web applications’ traffic demand fluctuates widely and un- vision for the normal load, but not able to handle peak when predictably. The common practice of provisioning a fixed it does materialize. Using the elastic provisioning capability capacity would either result in unsatisfied customers (un- of a cloud, a web application can ideally provision its infras- derprovision) or waste valuable capital investment (overpro- tructure tracking the load in real time and pay only for the vision). By leveraging an infrastructure cloud’s on-demand, capacity needed to serve the real application demand. pay-per-use capabilities, we finally can match the capacity Due to the large infrastructure capacity a cloud provides, with the demand in real time. This paper investigates how there is a common myth that an application can scale up we can build a large-scale web server farm in the cloud. Our unlimitedly and automatically when application demand in- performance study shows that using existing cloud compo- creases. In reality, our study shows that scaling an appli- nents and optimization techniques, we cannot achieve high cation in a cloud is more difficult, because a cloud is very scalability. Instead, we propose a client-side load balanc- different from a traditional enterprise infrastructure in at ing architecture, which can scale and handle failure on a least several respects. milli-second time scale. We experimentally show that our First, in enterprises, application owners can choose an op- architecture achieves high throughput in a cloud environ- timal infrastructure for their applications amongst various ment while meeting QoS requirements. options from various vendors. In comparison, a cloud infras- tructure is owned and maintained by the cloud providers. Because of their commodity business model, they only of- 1. INTRODUCTION fer a limited set of infrastructure components. For example, An infrastructure cloud, such as Amazon’s EC2/S3 ser- Amazon EC2 only offers 5 types of virtual servers and ap- vices [2], promises to fundamentally change the economics plication owners cannot customize the specification of them. of computing. First, it provides a practically unlimited in- Second, again due to its commodity business model, a frastructure capacity (e.g., computing servers, storage or cloud typically only provides commodity Virtual Machines network) on demand. Instead of grossly over-provisioning (VM). The computation power and the network bandwidth upfront due to uncertain demands, users can elastically pro- is typically less than high-end servers. For example, all Ama- vision their infrastructure resources from the provider’s pool zon VMs are capable of at most transmitting at roughly only when needed. Second, the pay-per-use model allows 800Mbps, whereas, commercial web servers routinely have users to pay for the actual consumption instead of for the several Network Interface Cards (NIC), each capable of at peak capacity. Third, a cloud infrastructure is much larger least 1Gbps. The commodity VMs require us to use hori- than most enterprise data centers. The economy of scale, zontal scaling to increase the system capacity. both in terms of hardware procurement and infrastructure Third, unlike in an enterprise, application owners have lit- management and maintenance, helps to drive down the in- tle or no control of the underlying cloud infrastructure. For frastructure cost further. example, for security reasons, Amazon EC2 disabled many These characteristics make cloud an attractive infrastruc- networking layer features, such as ARP, promiscuous mode, ture solution especially for web applications due to their IP spoofing, and IP multicast. Application owners have no variable loads. Because web applications could have a dra- ability to change these infrastructure features. Many per- matic difference between their peak load (such as during formance optimization techniques rely on the infrastructure flash crowd) and their normal load, a traditional infrastruc- choice and control. For example, to scale a web application, ture is ill-suited for them. We either grossly over-provision application owners either ask for a hardware load balancer or ask for the ability to assign the same IP address to all web servers to achieve load balancing. Unfortunately, nei- ther option is available in Amazon EC2. Permission to make digital or hard copies of all or part of this work for Last, commodity machines are likely to fail more frequently. personal or classroom use is granted without fee provided that copies are Any architecture design based on cloud must handle machine not made or distributed for profit or commercial advantage and that copies failures quickly, ideally in a few milli-seconds or faster, in or- bear this notice and the full citation on the first page. To copy otherwise, to der not to frequently disrupt service. republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Because of these characteristics, cloud-hosted web appli- SAC’10 March 22-26, 2010, Sierre, Switzerland. cations tend to run on a cluster with many standard com- Copyright 2010 ACM 978-1-60558-638-0/10/03 ...$10.00.
  • 2. modity web servers, thus requiring a scalable and agile load balancer. For example, in our test [11], we found that an balancing solution. In this study, we propose a client-side Amazon EC2 instance can handle at most 400 Mbps com- load balancing architecture that not only leverages the strength bined ingress and egress traffic. of existing cloud components, but also overcomes the limi- Even though some cloud platforms, such as Google App tations posed above. More specifically, we present the fol- Engine [7], implicitly offer a hardware-based load balancer, lowing contributions. we cannot easily get around their limitations because of the limited control we have. In our test, Google App Engine is 1. Propose client-side load balancing architecture: only able to handle 10 Mbps in/out or less traffic because of Differing from previous proposals on client-side load its quota mechanism. balancing, our proposal is built on insights gained from HTTP protocol [6] has a built-in HTTP redirect capa- our performance studies of cloud components. We bility, which can instruct the client to send the request to leverage the strength of a cloud component (S3’s scal- another location instead of returning the requested page. ability) to avoid any single point of scalability bottle- Using HTTP redirect, a front-end server can load balance neck. traffic to a number of back-end servers. However, just like a software load balancer, a single point of failure and scala- 2. A practical implementation: Previous imple- bility bottleneck still exist. mentations are not transparent to end users. We use JavaScript technology to handle all load-balancing de- tails behind the scene. From a user’s perspective, he is not able to distinguish a web site using client-side load 2.2 DNS Load Balancing balancing from a normal web site. We use JavaScript Another well established technique is DNS aliasing [10]. to get around current browsers’ cross-domain security When a user browses to a domain (e.g., www.website.com), limitations. the browser first asks its local DNS server for the IP address (e.g., 209.8.231.11), then, the browser contacts the IP ad- 3. Realistic evaluation: We evaluate the proposed ar- dress. In case the local DNS server does not have the IP chitecture using a realistic benchmark suite–SPECweb- address information for the asked domain, it contacts other 2005 [14]. Our evaluation shows that our proposed DNS servers that have the information, which will eventu- architecture can indeed scale linearly as demand in- ally be the original DNS server that the web server farm creases. directly manages. The original DNS server can hand out different IP addresses to different requesting DNS servers so In the rest of the paper, we show the limitations of cloud that the load could be distributed out among the servers to host a web presence using the standard techniques. We sitting at each IP address. then describe our client-side load balancing architecture and DNS load balancing has its drawbacks–load balancing gran- implementation. Last, we present the evaluation results. ularity and adaptiveness–that are not specific to the cloud. First, it does a poor job in balancing the load. For per- 2. PRIOR WORK formance reasons, a local DNS server caches the IP address information. Thus, all browsers contacting the same DNS There are well established techniques to scale a web server server would get the same IP address. Since the DNS server farm in an owned infrastructure. We will briefly visit them could be responsible for a large number of hosts, the load here and point out their limitations if deployed in cloud. could not be effectively smoothed out. Second, the local DNS server caches IP address for a set period of time, e.g., for days. Until the cache expires, the 2.1 Load Balancer local DNS server guides requests from browsers to the same A standard way to scale web applications is by using a web server. When traffic fluctuates at a time scale much hardware-based load balancer [5]. The load balancer as- smaller than days, tweaking DNS server settings has little sumes the IP address of the web application, so all com- effect. Traditionally, this drawback have not been as pro- munication with the web application hits the load balancer nounced because the number of back-end web servers and first. The load balancer is connected to one or more iden- their IP addresses are static anyway. However, it seriously tical web servers in the back-end. Depending on the user affects the scalability of a cloud-based web server farm. A session and the load on each web server, the load balancer cloud-based web server farm elastically changes the num- forwards packets to different web servers for processing. The ber of web servers tracking the volume of traffic in minutes hardware-based load balancer is designed to handle high- granularity. Days of DNS caching dramatically reduces this level of load, so it can easily scale. elasticity. More specifically, even though the web server farm However, a hardware-based load balancer uses applica- increases the number of web servers to serve the peak load, tion specific hardware-based components, thus it is typically IP addresses for new web servers will not be propagated to expensive. Because of cloud’s commodity business model, DNS servers that already have a cached IP address. There- a hardware-based load balancer is rarely offered by cloud fore, the requests relying on those DNS servers will keep be- providers as a service. Instead, one has to use a software- ing sent to the old web servers which overloads them while based load balancer running on a generic server. the new web servers remain idle. In addition, when a web A software-based load balancer [8, 12, 1] is not a scalable server fails, the DNS entry could not be immediately up- solution, though. The scalability is usually limited by the dated. While the DNS changes propagate, users are not CPU and network bandwidth capacity of the generic server able to access the service even though there are other live that the load balancer runs on, and a generic server’s ca- web servers. pacity is much smaller than that of a hardware-based load
  • 3. 2.3 Layer 2 Optimization 3.1 Cloud Components’ Performance Charac- In an enterprise where one can fully control the infras- teristics tructure, we can apply layer 2 optimization techniques to We have run an extensive set of performance tests on a build a scalable web server farm that does not impose all number of cloud components to understand their perfor- drawbacks discussed above: expensive hardware, single per- mance limits. The results are reported in a technical re- formance bottleneck, and lack of adaptiveness. port [11] and they are not reproduced here due to space There are several variations of layer 2 optimization. One limitations (we do not cite it to facilitate double-blind re- way, referred to as direct web server return [4], is to have view). A few key observations from the performance study a set of web servers, all have the same IP address, but dif- motivated our design. They are listed as follows: ferent layer 2 addresses (MAC address). A browser request may first hit one web server, which may in turn load balance • When used as a web server, a cloud virtual machine has the request to other web servers. However, when replying a much smaller capacity than a dedicated web server. to a browser request, any web server can directly reply. By For example, in our test, an m1.small Amazon instance removing the constraint that all replies have to go through is only able to handle roughly 1000 SPECweb2005 [14] the same server, we can achieve higher scalability. This tech- sessions. In contrast, as reported on SPECweb2005 nique requires the ability to dynamically change the map- website, a dedicated web server can handle up to 11,000 ping between an IP address and a layer 2 address at the sessions. router level. Another variation, TCP handoff [9], works in a slightly different way. A browser first establishes a TCP connection • When used as a software load balancer, a cloud vir- with a front-end dispatcher. Before any data transfer occurs, tual machine has an even more limited capability. For the dispatcher transfers the TCP state to one of the back- example, because of traffic relaying, any Amazon in- end servers, which takes over the communication with the stances can only handle 400Mbps client traffic, half client. This technique again requires the ability for the back- of what the network interface can support (800Mbps). end servers to masquerade the dispatcher’s IP address. Similarly, we found Google App Engine cannot sup- Unfortunately, this ability could open doors for security port high traffic when used as a load balancer. Thus, a exploits. For example, one can intercept all packets target- different mechanism is needed in order to scale higher. ing for a host by launching another host with the same IP address. Because of the security concerns, Amazon EC2 dis- • Amazon S3 is designed for static content distribution. ables all layer 2 capabilities so that any layer 2 technique to It has built in a high-degree of scalability. In our tests, scale an application will not work in Amazon cloud. it can sustain at least 16Gbps throughput. However, S3 can only host static files; it has no ability to run any server side processing such as JSP, CGI, or PHP. 2.4 Client Load Balancing The concept of client side load balancing is not new [3]. 3.2 Overview and Originality One existing approach, the earlier version of NetScape, re- We present a new web server farm architecture: client-side quires modification to the browser. Given the diversity of load balancing. With this architecture, a browser decides on web browsers available today, it is difficult to make sure that a web server that it will communicate with amongst available the visitors to a web site have the required modification. back-end web servers in the farm. The decision is based on Smart Client [18], developed as part of the WebOS project the information that lists the web server IP addresses and [15][16], requires Java Applets to perform load balancing at their individual loads. the client. Unfortunately, it has several drawbacks. First, The new architecture gets around limitations posed by Java Applets require the Java Virtual Machine, which is not cloud components, and achieves a high degree of scalabil- available by default on most browsers. This is especially true ity with infrastructure components currently available from in the mobile environment. Second, if the user accidentally cloud providers. agrees, a Java Applet could have full access to the client ma- Compared to a software load balancer, our architecture chine, leaving open a big security vulnerability. Third, many has no single point of scalability bottleneck. Instead, the organizations only allow administrators to install software, browser decides on the back-end web server from the list so users cannot view applets by default. Fourth, a Java Ap- of servers and communication flows directly between the plet is an application; the HTML page navigation structure browser and the chosen back-end web server. Compared to is lost if navigating within the applet. Last, Smart Client DNS aliasing technique, our architecture has a finer load still relies on a central server to download the Java Applet balancing granularity and adaptiveness. Because client’s and the server list, which still presents a single point of fail- browser makes the decision, we can distribute traffic in ses- ure and scalability bottleneck. sion granularity. Moreover, changes in web server list due to auto-scaling or failures can be quickly propagated to browsers (in milli-seconds) so that the clients would not experience extended congestion or outage. This is because the server 3. NEW ARCHITECTURE information is not cached in days but rather it is updated Since traditional techniques for designing a scalable web whenever a session is created. We achieve high scalability server farm would not work in a cloud environment, we need without requiring sophisticated control on the infrastructure to devise new techniques which leverage scalable cloud com- as layer 2 optimization does. Instead, IP addresses of web ponents while getting around their limitations. servers and their individual load information are sufficient.
  • 4. the probability of choosing any one is inversely pro- portional to its relative load. The weighted random distribution algorithm is designed to avoid all client browsers flash to the same web server at the same time, as a deterministic algorithm would do. 2. JavaScript sends a request to a proxy on the target web server. The proxy is currently implemented as another PHP web server running on the same machine but at a different port. The JavaScript sends over two pieces of information encoded as URL parameters. First, it sends the browser cookie associated with the site (doc- ument.cookie). Second, it sends the URL path (loca- tion.pathname). 3. The proxy uses the cookie and URL path to re-construct a new HTTP request; and sends the request to the ac- tual web server. Figure 1: Browser, S3 and web server interaction in 4. The web server processes the request; invokes dynamic our client-side load balancing architecture script processor such as CGI, PHP, or JSP, as neces- sary; and returns the result back to the proxy. 5. The proxy wraps around the result in a JavaScript. 3.3 Implementation 6. The client browser executes the returned JavaScript Our performance study showed that, being a purposely from the proxy; updates the page display; and updates designed platform, S3 has a high degree of scalability when the cookies if a set-cookie header has been returned. delivering static content. This is not surprising. In order to serve millions of customers, S3 has adopted a distributed An example of anchor page is shown below. It simply implementation that can easily scale. However, S3 is not includes two JavaScript sections along with an empty “To- suitable as a web hosting platform because modern web sites BeReplaced” tag which will be replaced later with the real have to deal with both static and dynamic contents. Amazon page content. S3 does not support dynamic content processing, such as CGI, PHP, or JSP. <html> In our architecture, we use back-end web servers for dy- <head><title></title> namic content processing, and use client-side load balancing <script type="text/javascript"> technique to distribute the traffic across the back-end web <!-- servers. We host the client-side logic (written in JavaScript) // the load balancing logic as well as the list of web servers and their load information in </script> S3 in order to avoid a single point of scalability bottleneck. <script type="text/javascript"> The detailed architecture is shown in Figure 1. For each // the server list and load dynamic page, we create an anchor static page. This anchor // information in JavaScript page includes two parts. The first part contains the list of // variables web servers’ IP addresses and their individual load (such as </script></head> CPU, memory, network bandwidth, etc.) information. They <body onLoad="load();"> are stored in a set of JavaScript variables that can be ac- <span id="ToBeReplaced"> </span> cessed directly from other JavaScript code. The second part </body></html> contains the client-side load balancing logic, again written As described above, the goal of the load balancing logic is in JavaScript. We need one anchor page for each dynamic to choose a back-end web server based on the load, send the page in case a user browses to the URL directly, however, client request (cookie along with URL path) to the proxy, re- the contents of the anchor pages are all the same. ceive the returned JavaScript and update the current HTML All anchor pages are hosted in S3 to achieve scalability. page. The JavaScript file returned from the proxy looks like We use S3’s domain hosting capability, which maps a domain the following. (by DNS aliasing) to S3. We create a bucket with the same name as the domain name (e.g., www.website.com). When function page() { a user accesses the domain, the request is routed to S3 and return "<HTML page content>"; S3 uses the host header to determine the bucket from which } to retrieve the content. function set-cookie() { When a client browser loads an anchor page, the browser <set cookie if instructed executes the following steps in JavaScript: by web server> } 1. Examine the load variables to determine to which web server it should send the actual request. The cur- The load balancing logic calls the page() function to replace rent algorithm randomly chooses a web server where the current page content (the “ToBeReplaced” tag) with the
  • 5. 18 string returned by page(). It also calls the set-cookie() func- aggregate throughput (Gbps) 16 tion which contains the logic to set the client side cookie if 14 12 the web server has indicated so. The set-cookie() function 10 may be empty if the server does not set any cookie. 8 Even though JavaScript has the capability to load addi- 6 4 tional content by using XMLHttpRequest, most browsers 2 would not allow XMLHttpRequest to a different server for 0 security reasons. Since we are making a request to a web 10 20 30 40 50 60 70 num of EC2 instances 80 90 100 server other than S3, we have to adopt an architecture like shown above. Figure 2: Aggregate S3 throughput as a function To avoid further round trip delays to fetch the anchor of the number of EC2 instances who simultaneously page, we keep the load balancing logic JavaScript in the query S3. browser memory. When a user clicks any link on the current page, the JavaScript intercepts the request, loads the corre- sponding link from the proxy, and replaces the current page Average Latency per content with the new page. If the web server fails during Request (second) a user session (the proxy is not responding), the JavaScript without CLB 0.407 randomly chooses another web server and resends the re- CLB per request 0.561 quest. This optimization (saving JavaScript in memory) CLB per session 0.483 also ensures that all requests from the same session go to the same back-end server to make it easy to maintain states Table 1: Average latency per request in seconds. across requests. SPECweb2005 Banking workload with 1000 simulta- neous sessions was evaluated. 4. EVALUATION In this section, we evaluate the scalability of the new client-side load balancing architecture described in Section 3. ber of simultaneous sessions that the web server can handle We believe that the architecture is scalable because 1) each while meeting its QoS requirement. For each test, the load client independently runs the computation to decide the cor- generator generates a number of simultaneous sessions, as responding back-end server, and 2) it removes the network specified by the user, and it collects the response time statis- bandwidth bottleneck of server-side load balancing. tics for each session. A test passes if 95 % of the pages re- To assess the scalability of the architecture, we use the turn within TIME TOLERABLE and 99 % of the pages re- SPECweb2005 benchmark [14], which is designed to simu- turn within TIME GOOD, where TIME TOLERABLE and late a real web application. It consists of three workloads: TIME GOOD are specified by the benchmark and they rep- banking, support, and ecommerce. As its name suggests, resent the QoS requirement. To find the maximum number the banking workload simulates the web server front-end of of sessions, we have to try a number of choices of the num- an online banking system. It handles all communications ber of user sessions until we find one that passes the QoS through SSL for security reasons and most of the requests requirement. The traffic generator is hosted in Amazon EC2 and responses are short. If a web server terminates a SSL since our Labs’ WAN network is not fast enough to support connection, the session has to be persistence, i.e., all future high traffic simulation. requests should be sent to the same web server in order to be decrypted. On the other hand, the support workload 4.1 Scalability of S3 simulates a product support website where users download In the client-side load balancing architecture, the system large files such as documentation files and device drivers. All that delivers the JavaScript as well as the static content be- communications are through regular HTTP and the largest comes a single point of contact for all clients. Therefore, the file to download is up to 40MB. The ecommerce workload scalability of the overall architecture relies on the scalability simulates an E-commerce website where users browse the of the hosting platform. site’s inventory (HTTP) and buy items (SSL). Therefore, in In this section, we assess the scalability of Amazon S3. terms of workload characteristics, it is a combination of the Since the SPECweb2005 benchmark dynamically generates above two. In this study, we focus on the banking workload the web pages, we cannot evaluate S3 directly using the because its many short requests and its session persistence benchmark. Instead, we host a large number of static files requirement stress a load balancer the most among the three on S3, and we launch a number of EC2 m1.small instances, workloads. each has 10 simultaneous TCP sessions sequentially request- The SPECweb2005 benchmark consists of two compo- ing these files one by one as fast as it is able to. Figure 2 nents: the web application and the traffic generator. The shows the aggregate throughput as a function of the number web application implements the backend application logic. of m1.small instances. As shown in the graph, S3 through- All pages are dynamically generated and a user can choose put increases linearly. At 100 instances, we achieved 16 Gbps from either a PHP implementation or a JSP implementa- throughput. Since we are accessing S3 from EC2, the latency tion. The traffic generator generates simulated user sessions is all below the TIME GOOD and TIME TOLERABLE pa- to interact with the backend web application, where each rameters in SPECweb2005. session simulates an individual browser. The traffic genera- tor could run on several servers in order to spread out the 4.2 Latency Impact traffic generating workload. As the client-side load balancing (CLB) architecture re- The performance metric for the benchmark is the num- quires clients to hit S3 to fetch a JavaScript file, it adds
  • 6. S3 CloudFront Sessions Latency (sec) Comcast network 93ms 45ms Single node 1,000 0.407 Stanford campus 82ms 4ms 12 node cluster 12,000 0.403 Work network 237ms 139ms EC2 172ms 4ms Table 3: Latency comparison: a client-side load bal- ancer adds negligible overhead to per request la- Table 2: Download latency from several edge loca- tency tions EC2 experiences a delay that is on the same order of mag- an extra round trip delay. Even though the architecture is nitude as our office network. Therefore, our evaluation in scalable–maintains reasonable latency per request regardless EC2 is a realistic lower bound. of the number of clients–it should keep the extra round trip The Amazon CloudFront offering enables S3 to be used as delay short enough to achieve the QoS requirement. geographically distributed content distribution servers. One To evaluate the impact of S3 round trip, we use SPECweb- can simply enable CloudFront on a bucket by issuing a web 2005 banking workload with 1000 simultaneous sessions in service API call, and the content is automatically cached in three different setups: 1) direct communication between a geographically distributed servers. In Table 2, we also show client and a web server without a load balancer as a baseline, the latency from CloudFront. The delay is always signifi- 2) CLB with S3 round trip per every HTTP request as a cantly smaller than its S3 counterpart. We note that Cloud- naive implementation, and 3) CLB with S3 round trip only Front currently has a longer time scale (minutes to create once per new session, which is the current implementation a distribution). Since we are aiming at a milli-seconds time described in Section 3. scale for load balancing and failure recovery, CloudFront is As shown in Table 1, S3 round trip adds about 154 milli- not yet suitable for our client-side load balancing architec- seconds of delay on average, which contributes 7.7% to the ture. TIME GOOD QoS requirement (2 seconds). However, when The results in Table 1 show that, even using S3 directly we apply the optimization that makes a S3 round trip only (instead of CloudFront), the latency added by the additional when it creates a new session, 1 the extra latency becomes round trip is acceptable. It is a small fraction of the 8 second negligible; the latency variation originating from EC2 in- rule [13]; thus, it is unlikely to impact the user perceived stances or cloud components’ dynamic performance varia- performance. tion is greater than the measured difference. Even though we perform the SPECweb test only in EC2, 4.3 Overall Scalability we believe the latency is not a problem even when accessed Finally, we assess the overall scalability of client-side load from outside of Amazon. Unfortunately, we do not have ac- balancing with the SPECweb2005 banking workload. We cess to a large number of external servers to perform load measure the average latency per request both on a single testing from outside of EC2. Instead, we evaluate the la- web server without load balancing serving 1,000 simultane- tency from a small set of external servers. ous sessions; and on a cluster with 12 web servers serving We measure the time it takes to download the JavaScript 12,000 simultaneous sessions. file which includes both the load balancing logic and the Table 3 shows that the cluster sustains roughly the same server load information. Along with the HTTP header, the average latency per request as the single web server. During file is about 1500 bytes. We use Wbox [17] to test the down- the experiment for the cluster, the 12 web servers experience load latency. roughly the same load, suggesting that the load balancing We perform the test from the following locations: algorithm can effectively smooth out the load. Based on S3’s scalability as measured in Section 4.1, we believe that • From a home network connected to Comcast’s cable client-side load balancing can further scale beyond 12,000 network in Sunnyvale, California. sessions, but we stop here because of economic constraints. • From our office network located in San Jose. Our traf- 5. CONCLUSIONS fic is routed to the Chicago head quarter before it is sent to the Internet. A cloud is an attractive infrastructure solution for web applications since it enables web applications to dynamically • From a server located on Stanford University campus. adjust its infrastructure capacity on demand. A scalable load balancer is a key building block to efficiently distribute • From within Amazon EC2. a large volume of requests and fully utilize the horizontally scaling infrastructure cloud. However, as we pointed out, it Table 2 shows the average latency for 10 runs of down- is not trivial to implement a scalable load balancer due to loading the same 1500 bytes anchor file from both S3 and both the cloud’s commodity business model and the limited CloudFront – Amazon’s content distribution network. infrastructure control allowed by cloud providers. As expected, our office network experiences the longest In this study, we propose the Client-side Load Balanc- delay due to its routing through our Chicago office. The ing (CLB) architecture using a scalable cloud storage ser- Comcast network and Stanford campus both experience a vice such as Amazon S3. Through S3, CLB directly deliv- much shorter delay. However, it is surprising to note that ers static contents while allowing a client to choose a cor- responding back-end web server for dynamic contents. A 1 client makes the load balancing decision based on the list Based on our measurement, SPECweb2005 banking makes 4.41 requests per session on average. of back-end web servers and their load information. CLB
  • 7. uses JavaScript to implement the load balancing algorithm, which not only makes the load balancing mechanism trans- parent to users, but also gets around browsers’ cross-domain security limitation. Our evaluation shows that the proposed architecture is scalable while introducing a small latency overhead. 6. REFERENCES [1] Accoria. Rock web server and load balancer. http://www.accoria.com. [2] Amazon Web Services. Amazon Web Services (AWS). http://aws.amazon.com. [3] V. Cardellini, M. Colajanni, and P. S. Yu. Dynamic load balancing on web-server systems. IEEE Internet Computing, 3(3):28–39, 1999. [4] L. Cherkasova. FLEX: Load Balancing and Management Strategy for Scalable Web Hosting Service. IEEE Symposium on Computers and Communications, 0:8, 2000. [5] F5 Networks. F5 Networks. http://www.f5.com. [6] R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, and T. Berners-Lee. Hypertext transfer protocol – http/1.1. In IETF RFC 2616, 1999. [7] Google Inc. Google App Engine. http://code.google.com/appengine/. [8] HaProxy. HaProxy load balancer. http://haproxy.1wt.eu/. [9] G. Hunt, E. Nahum, and J. Tracey. Enabling content-based load distribution for scalable services. Technical report, 1997. [10] E. Katz, M. Butler, and R. McGrath. A scalable HTTP server: The NCSA prototype. In Proc. First International Conference on the World Wide Web, Apr. 1994. [11] H. Liu and S. Wee. Web Server Farm in the Cloud: Performance Evaluation and Dynamic Architecture. In Proc. of the 1st International Conference on Cloud Computing (CloudCom 2009), Dec 2009. [12] Nginx. Nginx web server and load balancer. http://nginx.net/. [13] Z. Research. The need for speed II. http://www.keynote.com/downloads/Zona Need For Speed.pdf. [14] SPEC. SPECweb2005 benchmark. http://spec.org/web2005/. [15] A. Vahdat, T. Anderson, M. Dahlin, E. Belani, D. Culler, P. Eastham, and C. Yoshikawa. WebOS: Operating System Services for Wide Area Applications. In Proc. of the 7th IEEE International Symposium on High Performance Distributed Computing, pages 52–63, 1998. [16] A. Vahdat, M. Dahlin, P. Eastham, C. Yoshikawa, T. Anderson, and D. Culler. WebOS: Software Support for Scalable Web Services. In Proc. the Sixth Workshop on Hot Topics in Operating Systems, 1997. [17] Wbox HTTP testing tool. http://www.hping.org/wbox/. [18] C. Yoshikawa, B. Chun, P. Eastham, A. Vahdat, T. Anderson, and D. Culler. Using Smart Clients to Build Scalable Services. In Proc. USENIX 1997 Annual Technical Conference, Jan 1997.