a self-tuning page cleaner for the db2 buffer pool wenguang wang rick bunt department of computer...

15
A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

Upload: willis-hensley

Post on 24-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

A Self-tuning Page Cleaner for the DB2 Buffer Pool

Wenguang Wang Rick Bunt

Department of Computer ScienceUniversity of Saskatchewan

Page 2: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 2

What is the Buffer Pool

• The buffer pool is an in-memory buffer which caches disk pages of the database

Buffer Pool

Database on Disks

Writes Reads

Applications

Upper layer of DBMSDBMS

Page 3: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 3

ChangedPagesFF

I/O Activities of Buffer Pool

Agent

FixpageA

BufferPool

Disks

A

Agent

FixpageC

Read C

SyncWrite F

CleanPages

Read B

Agent

FixpageB

E

Page Cleaner

Page Cleaner

B C

AsyncWrite

CleanPages

Page 4: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 4

Tuning for Performance

• Buffer pool performance is crucial to system performance

• Page cleaning is one of the key components of buffer pool performance

• Performance tuning is often difficult on large systems

• Self-tuning can make the tuning task much easier

Page 5: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 5

Methodology

• Find the most important parameters that need to be tuned– Measurement and trace-driven

simulation

• Design the self-tuning algorithm to tune these parameters automatically

• Evaluate the proposed self-tuning algorithm by trace-driven simulation

Page 6: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 6

Methodology

• DBMS: IBM DB2 7.1.0 for Windows

• Workload: TPC-C benchmark

• Validation of simulation results with measurements

0.95

1

1.05

1.1

1.15

1.2

1.25

0 10 20 30 40 50 60 70 80 90 100

Nor

mal

ized

Thr

ough

put

Number of Page Cleaners

Measurement resultsSimulation results

Page 7: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 7

Effect of the # of Page Cleaners

Proportion of sync writes is a useful control variable

0

0.1

0.2

0.3

0.4

0 10 20 30 40 50 60 70 80 90 100 0.95

1

1.05

1.1

1.15

1.2

Pro

port

ion

of s

ync

wri

tes

Nor

mal

ized

thro

ughp

ut

Number of Page Cleaners

Normalized throughput

Proportion ofsync writes

Page 8: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 8

Approach

Page cleaning speed is affected by the number of page cleaners

Automatically adjust the page cleaning speed

Force the observed proportion of sync writes to the desired proportion wd which is close to 0 (say 5%)

0

0.1

0.2

0.3

0.4

0 10 20 30 40 50 60 70 80 90 100 0.95

1

1.05

1.1

1.15

1.2

Pro

port

ion

of s

ync

wri

tes

Nor

mal

ized

thro

ughp

ut

Number of Page Cleaners

Normalized throughput

Proportion ofsync writes

wd

Page 9: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 9

The Self-tuning Algorithm

• Check the observed proportion of sync writes periodically

• If the observed proportion of sync writes > wd, increase the page cleaning speed

• If the observed proportion of sync writes < wd, decrease the page cleaning speed

Page 10: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 10

Results

Manually tuning can improve system throughput

0

0.5

1

1.5

2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

Nor

mal

ized

Thr

ough

put

Normalized Time

Manually TunedUntuned Configuration

Page 11: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 11

Results

Throughput of the self-tuning algorithm is comparable to that of the manually tuned system

0

0.5

1

1.5

2

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

Nor

mal

ized

Thr

ough

put

Normalized Time

Manually TunedSelf-tuned

Untuned Configuration

Page 12: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 12

Robustness

• Works well under different hardware configurations– Achieves throughput within 0.2-4.6% of

the manually tuned system

• The achieved throughput is insensitive to the parameters of the algorithm– Under a wide range of parameter values,

the throughput change is within 1%

Page 13: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 13

Summary

• Identified parameters that need to be tuned in a large commercial DBMS (IBM DB2)

• Proposed and evaluated a self-tuning algorithm for page cleaning in the buffer pool that– can achieve performance comparable to

a manually-tuned system, and– is robust

Page 14: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 14

Page 15: A Self-tuning Page Cleaner for the DB2 Buffer Pool Wenguang Wang Rick Bunt Department of Computer Science University of Saskatchewan

MASCOTS 2002 15

I/O Activities of Untuned Configuration

Effective page cleaning reduces need for sync writes

0

0.2

0.4

0.6

0.8

1

0 0.05 0.1 0.15 0.2 0.25 0.3

Pro

port

ion

Normalized Time

Prop. of physical reads

Prop. of physical sync writes

Prop. of physical async writes