load balancing

20
Load balancing Presented by 張張張

Upload: lelia

Post on 19-Jan-2016

84 views

Category:

Documents


1 download

DESCRIPTION

Load balancing. Presented by 張肇烜. Outline. Load Balancing Static Load Balancing Dynamic Load Balancing. Load Balancing. Use to distribute computations fairly across processors in order to obtain the highest possible execution speeds. Load Balancing (cont.). Static Load Balancing. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Load balancing

Load balancing

Presented by 張肇烜

Page 2: Load balancing

Outline

Load Balancing Static Load Balancing Dynamic Load Balancing

Page 3: Load balancing

Load Balancing

Use to distribute computations fairly across processors in order to obtain the highest possible execution speeds.

Page 4: Load balancing

Load Balancing (cont.)

P0

P1

P2

P3

P4

P0

P1

P2

P3

P4

Page 5: Load balancing

Static Load Balancing

Before the execution of any process. Some potential static load balancing:

Randomized algorithm Round robin algorithm Weight round robin algorithm

Page 6: Load balancing

Static Load Balancing (cont.)

Randomized algorithms: Selects processes at random to take tasks.

B

D

A

C

E

Page 7: Load balancing

Static Load Balancing (cont.)

Round robin algorithms: Passes out tasks in sequential order of processes

coming back to the first when all processes have been given a task.

B

D

A

C

E

Page 8: Load balancing

Static Load Balancing (cont.)

Weighted round robin algorithms: To improve imbalance problem of RR.

B weight:3

D weight:2

A weight:1

C weight:4

E weight:5

Page 9: Load balancing

Static Load Balancing (cont.)

Several flaws: Very difficult to estimate accurately the execution

times of various parts of a program without actually executing the parts.

Communication delays that vary under different circumstances.

Page 10: Load balancing

Dynamic Load Balancing

Vary load during the execution of the processes.

Does incur an additional overhead during execution, but it is much more effective than static load balancing.

Page 11: Load balancing

Dynamic Load Balancing (cont.)

Can be classified as: Centralized Decentralized

Page 12: Load balancing

Dynamic Load Balancing (cont.)

Centralized DLB: Tasks handed out from a centralized location.

Master-slave structure.

……Queue

Master process

Tasks

Work pool

Slave worker processes

Page 13: Load balancing

Dynamic Load Balancing (cont.)

Decentralized DLB: A worker process may receive tasks from other

worker processes and may send tasks to other worker processes.

Process

Process

ProcessProcess

Process

Requests/tasks

Page 14: Load balancing

Dynamic Load Balancing (cont.)

Task transfer mechanisms: Receiver-Initiated Method Sender-Initiated Method

Page 15: Load balancing

Dynamic Load Balancing (cont.)

Receiver-Initiated Method: A process requests tasks from other processes it

selects. Typically, a process would request tasks from

other processes when it has few or no tasks to perform.

It has been shown to work well at high system load.

Page 16: Load balancing

Dynamic Load Balancing (cont.)

Sender-Initiated Method: A process sends tasks to other processes it

selects. Typically, a process with a heavy load passes out

some of its tasks to others that are willing to accept them.

It has been shown to work well for light over system load.

Page 17: Load balancing

Dynamic Load Balancing (cont.)

Some potential Dynamic load balancing : Least-Connection Algorithm (LC) Weighted Least-Connection Algorithm (WLC)

Page 18: Load balancing

Dynamic Load Balancing (cont.)

Least-Connection Algorithm : The requests are distributed to the server based

on the number of established connections. Least-connection algorithm performs well when

the loads of requests vary frequently.

Page 19: Load balancing

Dynamic Load Balancing (cont.)

Weighted Least-Connection Algorithm : Similar to weighted round robin algorithm, weights

can be combined to least-connection algorithm for heterogeneous environment.

Page 20: Load balancing

Dynamic Load Balancing (cont.)

Weighted Least-Connection Algorithm : 其算法流程如下,假設有一組伺服器 S = {S0, S1,

..., Sn-1} ,W(Si) 表示伺服器 Si的權重值, C(Si)表示伺服器 Si的目前連接數。而所有伺服器目前連接數的總和為 CSUM = ΣC(Si) (i=0, 1, .. , n-1) 。當前的新連接請求會被發送伺服器 Sm ,而且僅當伺服器 Sm 滿足以下條件, (C(Sm) / CSUM)/ W(Sm) = min { (C(Si) / CSUM) / W(Si)} (i=0, 1, . , n-1) ,其中W(Si) 不得為零。