SlideShare une entreprise Scribd logo
1  sur  6
Télécharger pour lire hors ligne
Problem statement
                                                                                             ? One web server isn’ enough
                                                                                                                 t
 Load-balancing                                                                                 ? Scaling performance
                                                                                                ? Tolerating failures
 web servers                                                                                    ? Rolling upgrades

                                                                                             ? Making many web servers look like one
                                                                                                ? Users can’ tell the difference
                                                                                                             t
  Scalable Internet Services and Systems, Spring 2001                                           ? Search engines can’ tell the difference
                                                                                                                        t
                                                                                                ? (servers can’ tell the difference)
                                                                                                               t
  Thorsten von Eicken                                                                        ? Why it is hard
  Department of Computer Science
                                                                                                ? Interesting web sites have per-user state
  University of California at Santa Barbara
                                                                                                ? Redundant sites have multiple feeds
                                                                                                ? Redundant sites have multiple locations
                                                                                                                                                       2




  Solution #1: redirect                                                                        Network design
? Idea: redirect to aux servers                                                              ? Assumptions
   ? Each server has its own name (www1.foo.com, www2.foo.com, etc.)
                                                                                                ? Co-location facility offers Fast-Ethernet “uplink”
   ? www.foo.com redirects to one of the others
   ? Example:                                                                                   ? Each server has one Fast-Ethernet interface
       ?   [buddy /] telnet foo.com 80
       ?   Trying 216.64.159.149...
       ?   Connected to foo.com.
       ?   Escape character is '^]'.
       ?   GET / http/1.0

       ?   HTTP/1.1 301 Moved Permanently
       ?   Date: Thu, 13 Apr 2000 06:13:48 GMT
       ?   Server: Apache/1.3.9 (Unix) secured_by_Raven/1.4.1pacheJServ
                                                            A         /1.1b1                                              switch
       ?   Location: http://www1. oo.com/index.html
                                f
       ?   Connection: close
       ?   Content-Type: text/html

       ?   <!DOCTYPE HTML PUBLIC " //IETF//DTD HTML 2.0//EN">
                                 -
       ?   <HTML><HEAD>
       ?
       ?
           <TITLE>301 Moved Permanently</TITLE>
           </HEAD><BODY>
                                                                                                     www        www1      www2       www3      www4
       ?   <H1>Moved Permanently</H1>
       ?   The document has moved <A HREF="http://www1.
                                                      foo.com/index.html">here</A>.<P>
       ?   <HR>
       ?   <ADDRESS>Apache/1.3.9 Server at 216.64.159.149 Port 80</ADDRESS>
       ?   </BODY></HTML>
       ?   Connection closed by foreign host.

                                                                                         3                                                             4
Redirect                                                      Solution #2: round-robin DNS
? Advantages                                                  ? Idea: round-robin DNS
  ? Easy to implement                                           ? Each web server has its own IP address
  ? Can customize load balancing algorithm                      ? Map www.yahoo.com to a different IP each time
  ? Location independent                                        ? Example:
                                                                   ?   [buddy /] host www.yahoo.com
  ?                                                                ?   www.yahoo.com           CNAME        www.yahoo.
                                                                                                                    akadns.net
                                                                   ?   www.yahoo.akadns.net   A            204.71.200.68
                                                                   ?   www.yahoo.akadns.net   A            204.71.202.160
                                                                   ?   www.yahoo.akadns.net   A            204.71.200.74
                                                                   ?   www.yahoo.akadns.net   A            204.71.200.75
                                                                   ?
? Disadvantages                                                    ?
                                                                       www.yahoo.akadns.net   A
                                                                       [buddy /] host www.yahoo.com
                                                                                                           204.71.200.67

  ? Which machine is www? What if it goes down?                    ?   www.yahoo.com           CNAME        www.yahoo.
                                                                                                                    akadns.net
                                                                   ?   www.yahoo.akadns.net   A            204.71.200.75
  ? Visible to user: bookmarks, search engines, …                  ?   www.yahoo.akadns.net   A            204.71.200.67
  ?                                                                ?   www.yahoo.akadns.net   A            204.71.200.68
                                                                   ?   www.yahoo.akadns.net   A            204.71.202.160
                                                                   ?   www.yahoo.akadns.net   A            204.71.200.74
                                                                   ?   [buddy /]


                                                          5                                                                      6




 Network design                                                Round-robin DNS
? Assumptions                                                 ? Advantages
  ? Co-location facility offers Fast-Ethernet “uplink”          ? Easy
  ? Each server has one Fast-Ethernet interface                 ? Cheap
                                                                ? Can customize DNS



                            switch                            ? Disadvantages
                                                                ? Caching of DNS resolutions
                                                                   ? Got TTL “time to live”field in secs
                                                                   ? Many DNS resolutions/sec
        ns1      www (1)   www (2)    www (3)   www (4)
                                                                ? Proxies




                                                          7                                                                      8
Solution #3: load bal switch                                                Network design
? Idea: place an intelligent router in front of servers                     ? Assumptions
   ? Products: Cisco local directory, F5 Big IP, Arrowpoint, …                 ?   Co-location facility offers Fast-Ethernet “uplink”
   ? Acts like a router, built like a router, doesn’ have a full TCP
                                                   t                           ?   Each server has one Fast-Ethernet interface
     stack or web server                                                       ?   Load-bal switch has 2 Fast-Ethernet interfaces
                                                                               ?   Load-bal switch uses NAT (network address translation)


                                                                                                           load bal



                                                                                                            switch




                                                                                      www1       www2       www3       www4       www5

                                                                        9                                                                   10




  Load balancing                                                              Detecting server failures
? Measuring the load: switch sees all connections                           ? Observing traffic
   ? Number of connections per server                                          ? Are requests being serviced?
   ? Avg response time per server                                              ? Problems:
   ? Bandwidth per server                                                           ? Unreliable: some requests take long

? Load balancing algorithms:                                                ? Probing the server
   ? Balancing the above metrics                                               ? Various protocols (what do they check?):
   ? Admin can “ dial-in” server load ratios                                        ? ICMP ping: test network & kernel
       ? Differing server hardware                                                  ? TCP connection set-up: process is running
       ? Ramp server down, ramp server up                                           ? HTTP HEAD (or GET): is serving pages
   ? Based on URI (e.g. /images, or /cgi-bin)                                  ? Probe parameters
                                                                                    ? Interval
                                                                                    ? Failure count
                                                                                    ? Failure retry

                                                                       11                                                                   12
Sticky-ness                                                                                       Implementation
? How are shopping carts implemented?                                                             ? Switch must inspect IP, TCP, and HTTP headers
    ? Or “ page” or newsgroups, or …
          my      ,                                                                                   ? Problem: getting to the HTTP header requires several round-
    ? Need a “session” recognize user based on:
                      :                                                                                 trips between client & server…
          ? IP address
                ? Can change                                                                      ? TCP/IP refresher
                ? Can be the same for many users                                                      ? IP header
          ? Cookie (HTTP)                                                                                   ? Source/dest IP address
                ? Can be turned off                                                                         ? Protocol ID (TCP)
          ? URL encoding                                                                              ? TCP header
                ? Hard to parse (http://… ./… /… /… ?… &… &SID=01234&…
                                                                                                            ?   Source/dest ports
          ? SSL session
                                                                                                            ?   Syn, Fin, Rst, … flags
                                                                                                            ?   Sequence number (byte granularity)
                                                                                                            ?   Ack sequence number



                                                                                             13                                                                                                  14




  TCP connection set-up                                                                             TCP connection end
soumak -> expert21-4   IP D= 10.16.4.121 S=10.3.1.2 LEN=48, ID=10988                              ________________________________
soumak -> expert21-4   TCP D=80 S=2542 Syn Seq=2204568154 Len=0 Win=32767 Options=<mss              expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=1500, ID=25639
1460,nop,nop,sackOK>                                                                                expert21-4 -> soumak TCP D=2542 S=80     Ack=2204568510 Seq=1799305953   Len=1460 Win=8760
soumak -> expert21-4   HTTP C port=2542                                                             expert21-4 -> soumak HTTP (body)
________________________________                                                                  ________________________________
  expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=48, ID=25635                                 expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=42, ID=25640
  expert21-4 -> soumak TCP D=2542 S=80 Syn Ack=2204568155 Seq=1799303032 Len=0 Win=8760             expert21-4 -> soumak TCP D=2542 S=80     Ack=2204568510 Seq=1799307413   Len=2 Win=8760
Options=<nop,nop,sackOK,mss 1460>                                                                   expert21-4 -> soumak HTTP (body)
  expert21-4 -> soumak HTTP R port=2542                                                           ________________________________
________________________________                                                                  soumak -> expert21-4   IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=10996
soumak -> expert21-4   IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=10990                               soumak -> expert21-4   TCP D=80 S=2542     Ack=1799307415 Seq=2204568510   Len=0 Win=32767
soumak -> expert21-4   TCP D=80 S=2542     Ack=1799303033 Seq=2204568155 Len=0 Win=32767          soumak -> expert21-4   HTTP C port=2542
soumak -> expert21-4   HTTP C port=2542                                                           ________________________________
________________________________                                                                    expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=40, ID=25680
soumak -> expert21-4   IP D=10.16.4.121 S=10.3.1.2 LEN=395, ID=10991                                expert21-4 -> soumak TCP D=2542 S=80 Fin Ack=2204568510 Seq=1799307415   Len=0 Win=8760
soumak -> expert21-4   TCP D=80 S=2542     Ack=1799303033 Seq=2204568155 Len=355 Win=32767          expert21-4 -> soumak HTTP R port=2542
soumak -> expert21-4   HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.1                          ________________________________
________________________________                                                                  soumak -> expert21-4   IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=11017
  expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=40, ID=25636                               soumak -> expert21-4   TCP D=80 S=2542     Ack=1799307416 Seq=2204568510   Len=0 Win=32767
  expert21-4 -> soumak TCP D=2542 S=80     Ack=2204568510 Seq=1799303033 Len=0 Win=8760           soumak -> expert21-4   HTTP C port=2542
  expert21-4 -> soumak HTTP R port=2542                                                           ________________________________
________________________________                                                                  soumak -> expert21-4   IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=11023
  expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=1500, ID=25637                             soumak -> expert21-4   TCP D=80 S=2542Rst Seq =2204568510 Len=0 Win=0
  expert21-4 -> soumak TCP D=2542 S=80     Ack=2204568510 Seq=1799303033 Len=1460 Win=8760        soumak -> expert21-4   HTTP C port=2542
  expert21-4 -> soumak HTTP HTTP/1.1 200 OK
________________________________
  expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=1500, ID=25638
  expert21-4 -> soumak TCP D=2542 S=80     Ack=2204568510 Seq=1799304493 Len=1460 Win=8760
  expert21-4 -> soumak HTTP (body)
________________________________
soumak -> expert21-4   IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=10994
soumak -> expert21-4   TCP D=80 S=2542     Ack=1799305953 Seq=2204568510 Len=0 Win=32767
soumak -> expert21-4   HTTP C port=2542




                                                                                             15                                                                                                  16
NAT: network address translation                                       TCP connection set-up
? NAT device changes headers on the fly:                               __ client
                                                                         2.94950
                                                                                   -> switch ______________________________
                                                                                   216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=60, ID=48397
                                                                         2.94950   216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421 Syn Seq=899863543 Len=0 Win=32120 …
   ? Server IP address                                                 __ switch
                                                                         2.95125
                                                                                   -> client ______________________________
                                                                                   208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=48, I D=26291
                                                                         2.95125   208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80 Syn Ack=899863544 Seq=1908949446 Len=0 …
   ? Server TCP sequence numbers                                       __ client
                                                                         2.98324
                                                                                   -> switch ______________________________
                                                                                   216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=40, I D=48400
                                                                         2.98324   216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421     Ack=1908949447 Seq=899863544 Len=0 …
   ? (outgoing connections require different changes)                  __ client   -> switch ______________________________
                                                                         2.98395   216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=154,  ID=48401
                                                                         2.98395   216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421     Ack=1908949447 Seq=899863544 Len=114 …
                                                                         2.98395   216.64.159.149 -> 208.50.157.136 HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.0
                                                                       __ switch   -> server ______________________________
                                                                         0.00000   216.64.159.149 -> 10.16.100.121 IP D=10.16.100.121 S=216.64.159.149 LEN=48, ID=26292
                                                                         0.00000   216.64.159.149 -> 10.16.100.121 TCP D=80 S=1421Syn Seq=899863543 Len=0 Win=32120 Options…
                                                                       __ server   -> switch ______________________________
                                                                         0.00001   10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=44, =22235
                                                                                                                                                                    ID
                                                                         0.00001   10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80  Syn Ack=899863544 Seq=2156657894 Len=0 …
                                                                       __ switch   -> server ______________________________
                                                                         0.00131   216.64.159.149 -> 10.16.100.121 IP D=10.16.100.121 S=216.64.159.149 LEN=154, =48401
                                                                                                                                                                    ID
                                                                         0.00131   216.64.159.149 -> 10.16.100.121 TCP D=80 S=1421     Ack=2156657895 Seq=899863544 Len=114 …
                                                                         0.00131   216.64.159.149 -> 10.16.100.121 HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.0
                                                                       __ server   -> switch ______________________________
                                                                         0.00134   10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=40, =22236
                                                                                                                                                                    ID
                                                                         0.00134   10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80      Ack=899863658 Seq=2156657895 Len=0 …
                                                                       __ switch   -> client ______________________________
                                                                         2.98619   208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=40, I D=22236
                                                                         2.98619   208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80     Ack=899863658 Seq=1908949447 Len=0 …
                                                                       __ server   -> switch ______________________________
                                                                         0.00298   10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=1500,   ID=22237
                                                                         0.00298   10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80      Ack=899863658 Seq=2156657895 Len=1460 …
                                                                         0.00298   10.16.100.121 -> 216.64.159.149 HTTP HTTP/1.1 200 OK
                                                                       __ switch   -> client ______________________________
                                                                         2.98828   208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=1500,  ID=22237
                                                                         2.98828   208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80     Ack=899863658 Seq=1908949447 Len=1460 …
                                                                         2.98828   208.50.157.136 -> 216.64.159.149 HTTP HTTP/1.1 200 OK

                                                                  17                                                                                                              18




  Solution #4: TCP forwarding                                            TCP forwarding
? Idea: forward the TCP connection to other server                     ? Advantages
   ? Product: Resonate                                                     ? Load balancer doesn’ see return traffic
                                                                                                 t
   ? Assumptions: request is small, processing it is expensive,            ? Doesn’ require separate device
                                                                                   t
     response is large                                                     ?
                                 client

                             1
        www                                                            ? Disadvantages
                                          3                                ? Load balancer doesn’ see return traffic
                                                                                                t
                                 2                                         ? Kernel driver mods
                                                                           ?



                        www1          www2          www3
                                                                  19                                                                                                              20
Load balancer redundancy                                                     Multiple feeds
? What if load-balancer fails?                                                ? Assumptions
   ? Load-balancer primary-backup fail-over                                     ? One server farm
   ? Issues: IP address take-over, established flows, load history              ? Two links, e.g. Fast-Ethernet from co-lo facility,DS-3 (45Mbps)
                                                                                  from ISP (UUnet, Sprint, AT&T, … )

                                                                              ? Problem: routing
                                                                                ? Outgoing packets: easy, pick the “better” uplink
             load bal                              load bal                     ? Incoming packets: hard, need to tell clients how to route
                                                                                    ? Internet routing protocol: BGP4 (border gateway protocol)
                                                                                    ? Primarily based on Address Space Numbers (ASNs)
              switch                                switch                                ? Each “network” has an ASN, announces to neighbors which ASNs it
                                                                                            can route to
                                                                                          ? Route metric is number of AS hops
                                                                                    ? Web site must have own ASN, and announce it to both uplinks
                                                                                          ? Typically, must have a /20(?) network to do that (4096 IP addrs)
  www1        www2       www3            www4       www5          www6
                                                                         21                                                                                    22




  Geographic distribution                                                      Perl regexp notes
? Wishes:                                                                     ? Comments in reg exp
   ? Serve diverse geographical regions with local servers                      ? Instead of
   ? Provide disaster-tolerance                                                     ? /s*(d+)s*([d.]+)s+(S+)s+->s+(S+)s+TCPsD=(d+)sS=(d+)/
                                                                                ? Write
? Problems:                                                                         ? m/s*(d+)s*([d.]+)      # pkt num, time
   ? Network topology does not map well to geography                                    s+(S+)s+->s+(S+)    # src ip, dst ip
                                                                                        s+TCPsD=(d+)sS=(d+) # dst port, src port
   ? Routing metrics count hops                                                        /x;
   ? BGP routing metrics count Address Spaces (AS)
                                                                              ? Regexp run-time…
? “Solutions”:                                                                  ? Regexp can take very long: backtracking
   ? DNS-resolve to “ closest” site based on routing metrics                        ? Sometimes reducing greedy-ness works…
   ? Perform “triangulation” experiments                                        ? Trick: use minimal matching:
         ? But: DNS server, firewalls, proxies, flukes, delays…                     ? /.*company: apple[^n]*ticker:s*(S+)s/s
                                                                                    ? /.*?company: apple[^n]*?ticker:s*(S+)s/s

                                                                         23                                                                                    24

Contenu connexe

En vedette

Web Servers - How They Work
Web Servers -  How They WorkWeb Servers -  How They Work
Web Servers - How They WorkBrian Gallagher
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Serverswebhostingguy
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)webhostingguy
 
Internet applications
Internet applicationsInternet applications
Internet applicationsNur Azlina
 
5 introduction to internet
5 introduction to internet5 introduction to internet
5 introduction to internetVedpal Yadav
 
Servers & Web Hosting
Servers & Web HostingServers & Web Hosting
Servers & Web HostingReza San
 
What Happens When You Own Google.com For A Minute?
 What Happens When You Own Google.com For A Minute? What Happens When You Own Google.com For A Minute?
What Happens When You Own Google.com For A Minute?Bhoomi Patel
 
Web servers (l6)
Web servers (l6)Web servers (l6)
Web servers (l6)Nanhi Sinha
 
Type "Google.com" into the Browser and Hit Enter: What Happens Next?
Type "Google.com" into the Browser and Hit Enter: What Happens Next?Type "Google.com" into the Browser and Hit Enter: What Happens Next?
Type "Google.com" into the Browser and Hit Enter: What Happens Next?Graeme Mathieson
 
ArcReady - Scalable And Usable Web Applications
ArcReady - Scalable And Usable Web ApplicationsArcReady - Scalable And Usable Web Applications
ArcReady - Scalable And Usable Web ApplicationsMicrosoft ArcReady
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicOracle
 

En vedette (20)

Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 
Web Server Load Balancing
Web Server Load BalancingWeb Server Load Balancing
Web Server Load Balancing
 
Web Servers - How They Work
Web Servers -  How They WorkWeb Servers -  How They Work
Web Servers - How They Work
 
Semantic Web Servers
Semantic Web ServersSemantic Web Servers
Semantic Web Servers
 
Download It
Download ItDownload It
Download It
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
 
5-WebServers.ppt
5-WebServers.ppt5-WebServers.ppt
5-WebServers.ppt
 
Web servers
Web serversWeb servers
Web servers
 
Internet applications
Internet applicationsInternet applications
Internet applications
 
5 introduction to internet
5 introduction to internet5 introduction to internet
5 introduction to internet
 
Servers & Web Hosting
Servers & Web HostingServers & Web Hosting
Servers & Web Hosting
 
Understanding
Understanding Understanding
Understanding
 
What Happens When You Own Google.com For A Minute?
 What Happens When You Own Google.com For A Minute? What Happens When You Own Google.com For A Minute?
What Happens When You Own Google.com For A Minute?
 
Web servers
Web serversWeb servers
Web servers
 
Web Server Primer
Web Server PrimerWeb Server Primer
Web Server Primer
 
Chrome OS user guide
Chrome OS user guideChrome OS user guide
Chrome OS user guide
 
Web servers (l6)
Web servers (l6)Web servers (l6)
Web servers (l6)
 
Type "Google.com" into the Browser and Hit Enter: What Happens Next?
Type "Google.com" into the Browser and Hit Enter: What Happens Next?Type "Google.com" into the Browser and Hit Enter: What Happens Next?
Type "Google.com" into the Browser and Hit Enter: What Happens Next?
 
ArcReady - Scalable And Usable Web Applications
ArcReady - Scalable And Usable Web ApplicationsArcReady - Scalable And Usable Web Applications
ArcReady - Scalable And Usable Web Applications
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
 

Similaire à Load-balancing web servers Load-balancing web servers

NU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web PerformanceNU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web PerformanceLee Roberson
 
Ultra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing SparUltra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing SparAaron White
 
Ruby Conf Preso
Ruby Conf PresoRuby Conf Preso
Ruby Conf PresoDan Yoder
 
05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver05.m3 cms list-ofwebserver
05.m3 cms list-ofwebservertarensi
 
Deployment Nirvana
Deployment NirvanaDeployment Nirvana
Deployment NirvanaAdrian Pike
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Nathan O'Hanlon
 
Building the Perfect SharePoint 2010 Farm - Sharing the Point South America
Building the Perfect SharePoint 2010 Farm - Sharing the Point South AmericaBuilding the Perfect SharePoint 2010 Farm - Sharing the Point South America
Building the Perfect SharePoint 2010 Farm - Sharing the Point South AmericaMichael Noel
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackIQ
 
IPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityIPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityCosimo Streppone
 
How Does the Internet Work? (Wix she codes; branch)
How Does the Internet Work? (Wix she codes; branch)How Does the Internet Work? (Wix she codes; branch)
How Does the Internet Work? (Wix she codes; branch)Dina Goldshtein
 
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
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 SystemsDavid Newman
 
Introduction to AWS (2020)
Introduction to AWS (2020)Introduction to AWS (2020)
Introduction to AWS (2020)John Dalziel
 
Web3.0 and mobility ......
Web3.0 and mobility ......Web3.0 and mobility ......
Web3.0 and mobility ......Mengis Raoul
 
It112 SharePoint 2010 Mythbusters
It112 SharePoint 2010MythbustersIt112 SharePoint 2010Mythbusters
It112 SharePoint 2010 MythbustersSpencer Harbar
 
Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming PrimerIvano Malavolta
 

Similaire à Load-balancing web servers Load-balancing web servers (20)

WebSocket protocol
WebSocket protocolWebSocket protocol
WebSocket protocol
 
NU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web PerformanceNU Web Steering Committee - Oct 11 - Web Performance
NU Web Steering Committee - Oct 11 - Web Performance
 
Ultra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing SparUltra-modern Front-end Dev & Introducing Spar
Ultra-modern Front-end Dev & Introducing Spar
 
Ruby Conf Preso
Ruby Conf PresoRuby Conf Preso
Ruby Conf Preso
 
05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver05.m3 cms list-ofwebserver
05.m3 cms list-ofwebserver
 
Deep Dive into AWS Fargate
Deep Dive into AWS FargateDeep Dive into AWS Fargate
Deep Dive into AWS Fargate
 
REST in Practice
REST in PracticeREST in Practice
REST in Practice
 
Deployment Nirvana
Deployment NirvanaDeployment Nirvana
Deployment Nirvana
 
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
 
Building the Perfect SharePoint 2010 Farm - Sharing the Point South America
Building the Perfect SharePoint 2010 Farm - Sharing the Point South AmericaBuilding the Perfect SharePoint 2010 Farm - Sharing the Point South America
Building the Perfect SharePoint 2010 Farm - Sharing the Point South America
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra
 
IPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityIPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalability
 
How Does the Internet Work? (Wix she codes; branch)
How Does the Internet Work? (Wix she codes; branch)How Does the Internet Work? (Wix she codes; branch)
How Does the Internet Work? (Wix she codes; branch)
 
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
 
A Tale of 2 Systems
A Tale of 2 SystemsA Tale of 2 Systems
A Tale of 2 Systems
 
Introduction to AWS (2020)
Introduction to AWS (2020)Introduction to AWS (2020)
Introduction to AWS (2020)
 
Web-MaxUriIdentifier
Web-MaxUriIdentifierWeb-MaxUriIdentifier
Web-MaxUriIdentifier
 
Web3.0 and mobility ......
Web3.0 and mobility ......Web3.0 and mobility ......
Web3.0 and mobility ......
 
It112 SharePoint 2010 Mythbusters
It112 SharePoint 2010MythbustersIt112 SharePoint 2010Mythbusters
It112 SharePoint 2010 Mythbusters
 
Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming Primer
 

Plus de webhostingguy

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Frameworkwebhostingguy
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guidewebhostingguy
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3webhostingguy
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidationwebhostingguy
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreementwebhostingguy
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...webhostingguy
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...webhostingguy
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructurewebhostingguy
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.pptwebhostingguy
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy webhostingguy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandiserswebhostingguy
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Productswebhostingguy
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mbwebhostingguy
 
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...webhostingguy
 

Plus de webhostingguy (20)

File Upload
File UploadFile Upload
File Upload
 
Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guide
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidation
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreement
 
Notes8
Notes8Notes8
Notes8
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructure
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.ppt
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandisers
 
OLUG_xen.ppt
OLUG_xen.pptOLUG_xen.ppt
OLUG_xen.ppt
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Products
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mb
 
Reseller's Guide
Reseller's GuideReseller's Guide
Reseller's Guide
 
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
Installation of MySQL 5.1 Cluster Software on the Solaris 10 ...
 

Load-balancing web servers Load-balancing web servers

  • 1. Problem statement ? One web server isn’ enough t Load-balancing ? Scaling performance ? Tolerating failures web servers ? Rolling upgrades ? Making many web servers look like one ? Users can’ tell the difference t Scalable Internet Services and Systems, Spring 2001 ? Search engines can’ tell the difference t ? (servers can’ tell the difference) t Thorsten von Eicken ? Why it is hard Department of Computer Science ? Interesting web sites have per-user state University of California at Santa Barbara ? Redundant sites have multiple feeds ? Redundant sites have multiple locations 2 Solution #1: redirect Network design ? Idea: redirect to aux servers ? Assumptions ? Each server has its own name (www1.foo.com, www2.foo.com, etc.) ? Co-location facility offers Fast-Ethernet “uplink” ? www.foo.com redirects to one of the others ? Example: ? Each server has one Fast-Ethernet interface ? [buddy /] telnet foo.com 80 ? Trying 216.64.159.149... ? Connected to foo.com. ? Escape character is '^]'. ? GET / http/1.0 ? HTTP/1.1 301 Moved Permanently ? Date: Thu, 13 Apr 2000 06:13:48 GMT ? Server: Apache/1.3.9 (Unix) secured_by_Raven/1.4.1pacheJServ A /1.1b1 switch ? Location: http://www1. oo.com/index.html f ? Connection: close ? Content-Type: text/html ? <!DOCTYPE HTML PUBLIC " //IETF//DTD HTML 2.0//EN"> - ? <HTML><HEAD> ? ? <TITLE>301 Moved Permanently</TITLE> </HEAD><BODY> www www1 www2 www3 www4 ? <H1>Moved Permanently</H1> ? The document has moved <A HREF="http://www1. foo.com/index.html">here</A>.<P> ? <HR> ? <ADDRESS>Apache/1.3.9 Server at 216.64.159.149 Port 80</ADDRESS> ? </BODY></HTML> ? Connection closed by foreign host. 3 4
  • 2. Redirect Solution #2: round-robin DNS ? Advantages ? Idea: round-robin DNS ? Easy to implement ? Each web server has its own IP address ? Can customize load balancing algorithm ? Map www.yahoo.com to a different IP each time ? Location independent ? Example: ? [buddy /] host www.yahoo.com ? ? www.yahoo.com CNAME www.yahoo. akadns.net ? www.yahoo.akadns.net A 204.71.200.68 ? www.yahoo.akadns.net A 204.71.202.160 ? www.yahoo.akadns.net A 204.71.200.74 ? www.yahoo.akadns.net A 204.71.200.75 ? ? Disadvantages ? www.yahoo.akadns.net A [buddy /] host www.yahoo.com 204.71.200.67 ? Which machine is www? What if it goes down? ? www.yahoo.com CNAME www.yahoo. akadns.net ? www.yahoo.akadns.net A 204.71.200.75 ? Visible to user: bookmarks, search engines, … ? www.yahoo.akadns.net A 204.71.200.67 ? ? www.yahoo.akadns.net A 204.71.200.68 ? www.yahoo.akadns.net A 204.71.202.160 ? www.yahoo.akadns.net A 204.71.200.74 ? [buddy /] 5 6 Network design Round-robin DNS ? Assumptions ? Advantages ? Co-location facility offers Fast-Ethernet “uplink” ? Easy ? Each server has one Fast-Ethernet interface ? Cheap ? Can customize DNS switch ? Disadvantages ? Caching of DNS resolutions ? Got TTL “time to live”field in secs ? Many DNS resolutions/sec ns1 www (1) www (2) www (3) www (4) ? Proxies 7 8
  • 3. Solution #3: load bal switch Network design ? Idea: place an intelligent router in front of servers ? Assumptions ? Products: Cisco local directory, F5 Big IP, Arrowpoint, … ? Co-location facility offers Fast-Ethernet “uplink” ? Acts like a router, built like a router, doesn’ have a full TCP t ? Each server has one Fast-Ethernet interface stack or web server ? Load-bal switch has 2 Fast-Ethernet interfaces ? Load-bal switch uses NAT (network address translation) load bal switch www1 www2 www3 www4 www5 9 10 Load balancing Detecting server failures ? Measuring the load: switch sees all connections ? Observing traffic ? Number of connections per server ? Are requests being serviced? ? Avg response time per server ? Problems: ? Bandwidth per server ? Unreliable: some requests take long ? Load balancing algorithms: ? Probing the server ? Balancing the above metrics ? Various protocols (what do they check?): ? Admin can “ dial-in” server load ratios ? ICMP ping: test network & kernel ? Differing server hardware ? TCP connection set-up: process is running ? Ramp server down, ramp server up ? HTTP HEAD (or GET): is serving pages ? Based on URI (e.g. /images, or /cgi-bin) ? Probe parameters ? Interval ? Failure count ? Failure retry 11 12
  • 4. Sticky-ness Implementation ? How are shopping carts implemented? ? Switch must inspect IP, TCP, and HTTP headers ? Or “ page” or newsgroups, or … my , ? Problem: getting to the HTTP header requires several round- ? Need a “session” recognize user based on: : trips between client & server… ? IP address ? Can change ? TCP/IP refresher ? Can be the same for many users ? IP header ? Cookie (HTTP) ? Source/dest IP address ? Can be turned off ? Protocol ID (TCP) ? URL encoding ? TCP header ? Hard to parse (http://… ./… /… /… ?… &… &SID=01234&… ? Source/dest ports ? SSL session ? Syn, Fin, Rst, … flags ? Sequence number (byte granularity) ? Ack sequence number 13 14 TCP connection set-up TCP connection end soumak -> expert21-4 IP D= 10.16.4.121 S=10.3.1.2 LEN=48, ID=10988 ________________________________ soumak -> expert21-4 TCP D=80 S=2542 Syn Seq=2204568154 Len=0 Win=32767 Options=<mss expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=1500, ID=25639 1460,nop,nop,sackOK> expert21-4 -> soumak TCP D=2542 S=80 Ack=2204568510 Seq=1799305953 Len=1460 Win=8760 soumak -> expert21-4 HTTP C port=2542 expert21-4 -> soumak HTTP (body) ________________________________ ________________________________ expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=48, ID=25635 expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=42, ID=25640 expert21-4 -> soumak TCP D=2542 S=80 Syn Ack=2204568155 Seq=1799303032 Len=0 Win=8760 expert21-4 -> soumak TCP D=2542 S=80 Ack=2204568510 Seq=1799307413 Len=2 Win=8760 Options=<nop,nop,sackOK,mss 1460> expert21-4 -> soumak HTTP (body) expert21-4 -> soumak HTTP R port=2542 ________________________________ ________________________________ soumak -> expert21-4 IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=10996 soumak -> expert21-4 IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=10990 soumak -> expert21-4 TCP D=80 S=2542 Ack=1799307415 Seq=2204568510 Len=0 Win=32767 soumak -> expert21-4 TCP D=80 S=2542 Ack=1799303033 Seq=2204568155 Len=0 Win=32767 soumak -> expert21-4 HTTP C port=2542 soumak -> expert21-4 HTTP C port=2542 ________________________________ ________________________________ expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=40, ID=25680 soumak -> expert21-4 IP D=10.16.4.121 S=10.3.1.2 LEN=395, ID=10991 expert21-4 -> soumak TCP D=2542 S=80 Fin Ack=2204568510 Seq=1799307415 Len=0 Win=8760 soumak -> expert21-4 TCP D=80 S=2542 Ack=1799303033 Seq=2204568155 Len=355 Win=32767 expert21-4 -> soumak HTTP R port=2542 soumak -> expert21-4 HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.1 ________________________________ ________________________________ soumak -> expert21-4 IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=11017 expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=40, ID=25636 soumak -> expert21-4 TCP D=80 S=2542 Ack=1799307416 Seq=2204568510 Len=0 Win=32767 expert21-4 -> soumak TCP D=2542 S=80 Ack=2204568510 Seq=1799303033 Len=0 Win=8760 soumak -> expert21-4 HTTP C port=2542 expert21-4 -> soumak HTTP R port=2542 ________________________________ ________________________________ soumak -> expert21-4 IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=11023 expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=1500, ID=25637 soumak -> expert21-4 TCP D=80 S=2542Rst Seq =2204568510 Len=0 Win=0 expert21-4 -> soumak TCP D=2542 S=80 Ack=2204568510 Seq=1799303033 Len=1460 Win=8760 soumak -> expert21-4 HTTP C port=2542 expert21-4 -> soumak HTTP HTTP/1.1 200 OK ________________________________ expert21-4 -> soumak IP D=10.3.1.2 S=10.16.4.121 LEN=1500, ID=25638 expert21-4 -> soumak TCP D=2542 S=80 Ack=2204568510 Seq=1799304493 Len=1460 Win=8760 expert21-4 -> soumak HTTP (body) ________________________________ soumak -> expert21-4 IP D=10.16.4.121 S=10.3.1.2 LEN=40, ID=10994 soumak -> expert21-4 TCP D=80 S=2542 Ack=1799305953 Seq=2204568510 Len=0 Win=32767 soumak -> expert21-4 HTTP C port=2542 15 16
  • 5. NAT: network address translation TCP connection set-up ? NAT device changes headers on the fly: __ client 2.94950 -> switch ______________________________ 216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=60, ID=48397 2.94950 216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421 Syn Seq=899863543 Len=0 Win=32120 … ? Server IP address __ switch 2.95125 -> client ______________________________ 208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=48, I D=26291 2.95125 208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80 Syn Ack=899863544 Seq=1908949446 Len=0 … ? Server TCP sequence numbers __ client 2.98324 -> switch ______________________________ 216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=40, I D=48400 2.98324 216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421 Ack=1908949447 Seq=899863544 Len=0 … ? (outgoing connections require different changes) __ client -> switch ______________________________ 2.98395 216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=154, ID=48401 2.98395 216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421 Ack=1908949447 Seq=899863544 Len=114 … 2.98395 216.64.159.149 -> 208.50.157.136 HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.0 __ switch -> server ______________________________ 0.00000 216.64.159.149 -> 10.16.100.121 IP D=10.16.100.121 S=216.64.159.149 LEN=48, ID=26292 0.00000 216.64.159.149 -> 10.16.100.121 TCP D=80 S=1421Syn Seq=899863543 Len=0 Win=32120 Options… __ server -> switch ______________________________ 0.00001 10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=44, =22235 ID 0.00001 10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80 Syn Ack=899863544 Seq=2156657894 Len=0 … __ switch -> server ______________________________ 0.00131 216.64.159.149 -> 10.16.100.121 IP D=10.16.100.121 S=216.64.159.149 LEN=154, =48401 ID 0.00131 216.64.159.149 -> 10.16.100.121 TCP D=80 S=1421 Ack=2156657895 Seq=899863544 Len=114 … 0.00131 216.64.159.149 -> 10.16.100.121 HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.0 __ server -> switch ______________________________ 0.00134 10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=40, =22236 ID 0.00134 10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=2156657895 Len=0 … __ switch -> client ______________________________ 2.98619 208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=40, I D=22236 2.98619 208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=1908949447 Len=0 … __ server -> switch ______________________________ 0.00298 10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=1500, ID=22237 0.00298 10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=2156657895 Len=1460 … 0.00298 10.16.100.121 -> 216.64.159.149 HTTP HTTP/1.1 200 OK __ switch -> client ______________________________ 2.98828 208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=1500, ID=22237 2.98828 208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=1908949447 Len=1460 … 2.98828 208.50.157.136 -> 216.64.159.149 HTTP HTTP/1.1 200 OK 17 18 Solution #4: TCP forwarding TCP forwarding ? Idea: forward the TCP connection to other server ? Advantages ? Product: Resonate ? Load balancer doesn’ see return traffic t ? Assumptions: request is small, processing it is expensive, ? Doesn’ require separate device t response is large ? client 1 www ? Disadvantages 3 ? Load balancer doesn’ see return traffic t 2 ? Kernel driver mods ? www1 www2 www3 19 20
  • 6. Load balancer redundancy Multiple feeds ? What if load-balancer fails? ? Assumptions ? Load-balancer primary-backup fail-over ? One server farm ? Issues: IP address take-over, established flows, load history ? Two links, e.g. Fast-Ethernet from co-lo facility,DS-3 (45Mbps) from ISP (UUnet, Sprint, AT&T, … ) ? Problem: routing ? Outgoing packets: easy, pick the “better” uplink load bal load bal ? Incoming packets: hard, need to tell clients how to route ? Internet routing protocol: BGP4 (border gateway protocol) ? Primarily based on Address Space Numbers (ASNs) switch switch ? Each “network” has an ASN, announces to neighbors which ASNs it can route to ? Route metric is number of AS hops ? Web site must have own ASN, and announce it to both uplinks ? Typically, must have a /20(?) network to do that (4096 IP addrs) www1 www2 www3 www4 www5 www6 21 22 Geographic distribution Perl regexp notes ? Wishes: ? Comments in reg exp ? Serve diverse geographical regions with local servers ? Instead of ? Provide disaster-tolerance ? /s*(d+)s*([d.]+)s+(S+)s+->s+(S+)s+TCPsD=(d+)sS=(d+)/ ? Write ? Problems: ? m/s*(d+)s*([d.]+) # pkt num, time ? Network topology does not map well to geography s+(S+)s+->s+(S+) # src ip, dst ip s+TCPsD=(d+)sS=(d+) # dst port, src port ? Routing metrics count hops /x; ? BGP routing metrics count Address Spaces (AS) ? Regexp run-time… ? “Solutions”: ? Regexp can take very long: backtracking ? DNS-resolve to “ closest” site based on routing metrics ? Sometimes reducing greedy-ness works… ? Perform “triangulation” experiments ? Trick: use minimal matching: ? But: DNS server, firewalls, proxies, flukes, delays… ? /.*company: apple[^n]*ticker:s*(S+)s/s ? /.*?company: apple[^n]*?ticker:s*(S+)s/s 23 24