2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

22
2/23/2004 Load Balancing February 23, 2004
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    220
  • download

    3

Transcript of 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

Page 1: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Load Balancing

February 23, 2004

Page 2: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Assignments

• Work on Registrar Assignment

Page 3: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Pieces of the Puzzle

Load Balancing

Servers

Data Store

Page 4: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Load Balancing

• Distribute load across multiple servers – why?

Page 5: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Load Balancing

• Distribute load across multiple servers – why?– Service more requests per second– Reduce response time– Tolerate failures

Page 6: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Simple Algorithm

• Round-robin– N servers– Request 1 goes to server 1– Request 2 goes to server 2– …– Request N goes to server N– Request N+1 goes to server 1

Page 7: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Problems

• What are some problems with this strategy?

Page 8: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Goals/Challenges

• Determining least loaded server

• Determining closest server

• Detecting and deflecting requests from failed server

• Transparency

• What about user state?

Page 9: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Strategies

• DNS-based

• Dispatcher-based

• Server-based

Page 10: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

DNS: Domain Name System

• How do I identify a computer?

• Hostname– ID for a computer– Examples?

• IP Address– Why is an IP needed?– Examples?

• Mapping from hostname to IP address?

Page 11: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

DNS: Domain Name System

• Name servers– Store hostname to IP mapping– Organized in a hierarchy– Act as a distributed database

• Application-layer protocol– Defines communication between hosts and name

servers

Page 12: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Usage Scenario

• Which apps use DNS?

• HTTP – Browser extracts hostname– Sends hostname to DNS– DNS does lookup and returns IP address– Browser sends HTTP GET to IP address

Page 13: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Simple DNS Example

• Host surf.eurecom.fr wants IP address of gaia.cs.umass.edu1. contacts its local DNS

server, dns.eurecom.fr

2. dns.eurecom.fr contacts root name server, if necessary

3. root name server contacts authoritative name server, dns.umass.edu, if necessary

requesting hostsurf.eurecom.fr

gaia.cs.umass.edu

root name server

authorititive name serverdns.umass.edu

local name serverdns.eurecom.fr

1

23

4

5

6

Page 14: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Strategy 1: DNS-based

138.110.1.1

138.110.1.2

138.110.1.3

DNS server

138.110.1.1138.110.1.2

138.110.1.3

Web Servers

Page 15: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Strategy 1: DNS-based

• Pros– Easy

• Cons– Simple algorithm may not distribute load best– Slow to deal with failures– Not transparent to client

• Caching may disrupt algorithm

Page 16: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Strategy 2: Dispatcher-based

138.110.1.1

138.110.1.2

138.110.1.3

Web Servers

Load balancing switch

Page 17: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Strategy 2: Dispatcher-based

• Pros– Transparent (NAT)– Reacts more quickly to failure– Apply more advanced scheduling algorithms

• Number of active connections• Based on URI (/images, etc)

• Cons– Bottleneck/single point of failure– New piece of hardware

Page 18: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Strategy 3: Server-based

138.110.1.1

138.110.1.2

138.110.1.3

Web Servers

DNS server

Page 19: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Strategy 3: Server-based

• Pros– Reacts more quickly to failure– Apply more advanced scheduling algorithms

• Cons– Not transparent– Increased delay

Page 20: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Data Replication/Partitioning

• Replication– All servers can serve all data

• Partitioning– Servers keep track of specific set of data

• In reality, both

Page 21: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Example

A-Z A-Z A-Z A-I J-R S-Z

Replication Partitioning

Page 22: 2/23/2004 Load Balancing February 23, 2004. 2/23/2004 Assignments Work on Registrar Assignment.

2/23/2004

Consistency

• All copies of same data should be the same– A change to one means a change to all

• Performance/consistency tradeoff