+ All Categories
Home > Documents > Load Balancing & Update Propagation in Tashkent+

Load Balancing & Update Propagation in Tashkent+

Date post: 13-Jan-2016
Category:
Upload: helena
View: 84 times
Download: 0 times
Share this document with a friend
Description:
Load Balancing & Update Propagation in Tashkent+. Sameh Elnikety Steven Dropsho Willy Zwaenepoel. EPFL. Load Balancing. Traditional: Optimize for equal load on replicas MALB (Memory-Aware Load Balancing) : Optimize for in-memory execution. MALB Doubles Throughput. 37 X. TPC-W - PowerPoint PPT Presentation
Popular Tags:
45
Load Balancing & Update Propagation in Tashkent+ Sameh Elnikety Steven Dropsho Willy Zwaenepoel EPFL
Transcript
Page 1: Load Balancing & Update Propagation in  Tashkent+

Load Balancing &Update Propagation in Tashkent+

Sameh Elnikety Steven Dropsho Willy Zwaenepoel

EPFL

Page 2: Load Balancing & Update Propagation in  Tashkent+

• Traditional: – Optimize for equal load on replicas

• MALB (Memory-Aware Load Balancing):– Optimize for in-memory execution

Load Balancing

Page 3: Load Balancing & Update Propagation in  Tashkent+

MALB Doubles Throughput

37 X TPC-W

Ordering

16 replicas

12 X

25 X

1 X

Page 4: Load Balancing & Update Propagation in  Tashkent+

• Traditional: – Propagate updates everywhere

• Update Filtering: – Propagate updates to where they are needed

Update Propagation

Page 5: Load Balancing & Update Propagation in  Tashkent+

12 X

MALB + UF Triples Throughput

25 X

37 X

TPC-W

Ordering

16 replicas

1 X

Page 6: Load Balancing & Update Propagation in  Tashkent+

• MALB (Memory-Aware Load Balancing):– Optimize for in-memory execution

• Update filtering: – Propagate updates to where they are needed

• Implementation: – Tashkent+ middleware

• Experimental evaluation:– Big performance gain

Contributions

Page 7: Load Balancing & Update Propagation in  Tashkent+

Background: DB Replication

Replica 2

Replica 1

Replica 3

SingleDBMS

Load Balancer

Page 8: Load Balancing & Update Propagation in  Tashkent+

Read Tx

Replica 2

Replica 1

Replica 3

Load Balancer

TT

Page 9: Load Balancing & Update Propagation in  Tashkent+

Update Tx

Replica 2

Replica 1

Replica 3

Load Balancer

TTwswswsws

Page 10: Load Balancing & Update Propagation in  Tashkent+

Traditional Load Balancing

Replica 2

Replica 1

Replica 3

Load Balancer

Equal load on replicas Equal load on replicas

MALB: (Memory-Aware Load Balancing)Optimize for in-memory execution

MALB: (Memory-Aware Load Balancing)Optimize for in-memory execution

Page 11: Load Balancing & Update Propagation in  Tashkent+

How Does MALB Work?

Database 2211 33

Workload A →

B →

MemMemory

2211

22 33

Page 12: Load Balancing & Update Propagation in  Tashkent+

A, B, A, B

A, B, A, B

Read Data From Disk

A, B, A, B

Replica 1

Mem

Disk

2211 33

22

Replica 2

Mem

Disk

2211 33

LeastLoaded

3311

SlowSlow

SlowSlow

A →

B →

2211

22 33

Page 13: Load Balancing & Update Propagation in  Tashkent+

Data Fits in MemoryReplica 1

Mem

Disk

2211 33

2211

Replica 2

Mem

Disk

2211 33

3322

MALB

FastFast

FastFast

A →

B →

2211

22 33A, A, A, A

B, B, B, BMemory info?Many tx and replicas?Memory info?Many tx and replicas?

A, B, A, B

Page 14: Load Balancing & Update Propagation in  Tashkent+

• Exploit tx execution plan– Which tables & indices are accessed– Their access pattern

• Linear scan, direct access

• Metadata from database– Sizes of tables and indices

Estimate Tx Memory Needs

Page 15: Load Balancing & Update Propagation in  Tashkent+

• Objective:– Construct tx groups that fit together in memory

• Bin packing:– Item: tx memory needs– Bin: memory of replica– Heuristic: Best Fit Decreasing

• Allocate replicas to tx groups– Adjust for group loads

Grouping Transactions

Page 16: Load Balancing & Update Propagation in  Tashkent+

Group A

MALB in Action

A B CD E F Replica

Replica

Replica

Group B C

A

Group D E F

B C

D E F

MALB

Disk

Disk

Disk

Memory needs forA, B, C, D, E, F

Page 17: Load Balancing & Update Propagation in  Tashkent+

• Objective:– Optimize for in-memory execution

• Method:– Estimate tx memory needs– Construct tx groups– Allocate replicas to tx groups

MALB Summary

Page 18: Load Balancing & Update Propagation in  Tashkent+

• Traditional: – Propagate updates everywhere

• Update Filtering: – Propagate updates to where they are needed

Update Propagation

Page 19: Load Balancing & Update Propagation in  Tashkent+

Group A

Update Filtering ExampleReplica 1

Group B

Mem

Disk

2211 33

2211

Replica 2

Mem

Disk

2211 33

3322

MALBUF

A →

B →

2211

22 33

A, B, A, B

Page 20: Load Balancing & Update Propagation in  Tashkent+

Group A

Update Filtering Example

Disk

Replica 1

Group B

Mem

2211

2211

Replica 2

Mem

Disk

2211 33

22

MALBUF

Updatetable 1

33

Updatetable 3

33

A →

B →

2211

22 33

A, B, A, B

Page 21: Load Balancing & Update Propagation in  Tashkent+

Update Filtering in Action

UF

Update tored table

Update togreen table

Page 22: Load Balancing & Update Propagation in  Tashkent+

• Middleware:– Based on Tashkent [EuroSys 2006]

• Consistency:– No change in consistency – Our workloads run serializably– GSI (Generalized Snapshot Isolation)

Tashkent+ Implementation

Page 23: Load Balancing & Update Propagation in  Tashkent+

• Compare:– LeastLoaded: optimize for equal load– MALB: optimize for in-memory execution– MALB+UF: propagate updates to where needed

• Environment:– Linux cluster running PostgreSQL– Workload: TPC-W Ordering (50% update txs)

Experimental Evaluation

Page 24: Load Balancing & Update Propagation in  Tashkent+

MALB Doubles Throughput

37 X TPC-W

Ordering

16 replicas105%105%

12 X

25 X

1 X

Page 25: Load Balancing & Update Propagation in  Tashkent+

BigSmall

Big

Small

MemSize

DBSize

Big Gains with MALB

4%4%0%0%29%29%

48%48%105%105%45%45%

182%182%75%75%12%12%

Run from memoryRun from memory

Run from disk

Run from disk

Page 26: Load Balancing & Update Propagation in  Tashkent+

MALB + UF Triples Throughput15 15

7 7

TPC-W

Ordering

16 replicas

4949%%

12 X

25 X

37 X

1 X

Page 27: Load Balancing & Update Propagation in  Tashkent+

1.49

0

0.5

1

1.5

2

MALB MALB+UF

Filtering Opportunities

50%Ordering Mix

5% Browsing Mix

1.02

0

0.5

1

1.5

2

MALB MALB+UF

Updates

Page 28: Load Balancing & Update Propagation in  Tashkent+

• MALB is better than LARD (we explain why)

• Methods for grouping transactions– Better be conservative in estimating memory

• Dynamic reallocation for MALB– Adjust to workload changes

• More workloads– TPC-W browsing & shopping– RUBiS bidding

Checkout the Paper

Page 29: Load Balancing & Update Propagation in  Tashkent+

• MALB (Memory-Aware Load Balancing):– Optimize for in-memory execution

• Update filtering: – Propagate updates to where they are needed

• Implementation: – Tashkent+ middleware

• Experimental evaluation:– Big performance gain, achievable in many cases

Conclusions

Page 30: Load Balancing & Update Propagation in  Tashkent+

• Questions?

• MALB (Memory-Aware Load Balancing):– Optimize for in-memory execution

• Update filtering: – Propagate updates to where they are needed

Thank You

Page 31: Load Balancing & Update Propagation in  Tashkent+

• Transaction type: – SELECT item-name– FROM shopping-cart

– WHERE user = ?

Example

Transaction type: AInstances: A1, A2, A3

Page 32: Load Balancing & Update Propagation in  Tashkent+

A: SELECT * FROM address WHERE id=$1

B: INSERT INTO course VALUES ($1, $2)

C: UPDATE emp SET sal=$1 WHERE id=$2

D: DELETE FROM bid WHERE id=$1

Transaction Types

Page 33: Load Balancing & Update Propagation in  Tashkent+

A: SELECT * FROM address WHERE id=$1

B: INSERT INTO course VALUES ($1, $2)

C: UPDATE emp SET sal=$1 WHERE id=$2

D: DELETE FROM bid WHERE id=$1

Transaction Types

A1: SELECT * FROM address WHERE id=10A2: SELECT * FROM address WHERE id=20A3: SELECT * FROM address WHERE id=76A4: SELECT * FROM address WHERE id=78A5: SELECT * FROM address WHERE id=97

Page 34: Load Balancing & Update Propagation in  Tashkent+

• MALB-S– Size

• MALB-SC– Size and contents– No double counting of shared tables & indices

• MALB-SCAP– Size, contents, and access pattern

• Overflow tx types– Each tx type in its own group

MALB Grouping

Page 35: Load Balancing & Update Propagation in  Tashkent+

Tx Grouping Alternatives

Page 36: Load Balancing & Update Propagation in  Tashkent+

• Collect CPU and disk utilizations

• Maintain smoothed averages

• Group load: average across replicas– Example

• 3 replicas• Data ( CPU, disk ) = (45, 10), (53, 9), (40, 8)• Group load = (46, 9)

• Comparing loads: max( CPU, disk )– Example

• Max(46, 9) = 46%

MALB Allocation – Load

Page 37: Load Balancing & Update Propagation in  Tashkent+

• Move one replica at a time– From least loaded group– To most loaded group

• Future load estimates– 2 replicas, 20% load -> 1 replica, 40%– 6 replicas, 25% load -> 5 replicas, 30%

• Hysteresis– Prevent oscillations– Trigger re-allocation if load difference > 1.25x

MALB Allocation – Basic

Page 38: Load Balancing & Update Propagation in  Tashkent+

• Quickly snap to a good configuration

• Solve set of simultaneous equations

• Example– Current configuration

• Group M, 3 replicas, 70%• Group N, 7 replicas, 10%

– Equations• Mrep + Nrep = 10• (70% * 3) / Mrep = (10% * 7) / Nrep

• Fine tune with additional adjustments

MALB Allocation – Fast

Page 39: Load Balancing & Update Propagation in  Tashkent+

Configuration of MALB-SC

Page 40: Load Balancing & Update Propagation in  Tashkent+

Disk IO

Average Disk IO per Transaction

Page 41: Load Balancing & Update Propagation in  Tashkent+

MALB & Update Filtering

TPC-W Ordering

LeastCon, MALB, MALB+UF

MidDB 1.8GB with different memory sizes

Page 42: Load Balancing & Update Propagation in  Tashkent+

MALB & Update Filtering

SmallDB 0.7GB BigDB 2.9GB

Page 43: Load Balancing & Update Propagation in  Tashkent+

Dynamic Reallocation

Page 44: Load Balancing & Update Propagation in  Tashkent+

• Load balancing– LARD, HACC, FLEX

• Workload of small static files• Do not estimate working set

• Replicated databases– Front-end load balancer

• Conflict-aware scheduling [Pedone06]– Reduce conflict and therefore abort rate

• Conflict-aware scheduling [Amza03]– Correctness

– Partial replication

Related Work

Page 45: Load Balancing & Update Propagation in  Tashkent+

• Replicated database systems– J. Gray et al., The Dangers of Replication and a Solution,

SIGMOD’96.– C. Amza, Consistent Replication for Scaling Back-end Databases for

Dynamic Content Servers, MiddleWare’03.– C. Plattner et al., Ganymed: Scalable Replication for Transactional

Web Applications, Middleware’04.– B. Kemme et al., Postgres-R(SI) Middleware based Data Replication

providing Snapshot Isolation, SIGMOD’05.– K. Daudjee and K. Salem, Lazy Database Replication with Snapshot

Isolation, VLDB’06.

• Networked server systems– V. Pai et al, Locality-aware Request distribution in Clustered-based

Network Servers, ASPLOS’98.

Related Work


Recommended