a self-tuning page cleaner for the db2 buffer pool wenguang wang rick bunt department of computer...
TRANSCRIPT
A Self-tuning Page Cleaner for the DB2 Buffer Pool
Wenguang Wang Rick Bunt
Department of Computer ScienceUniversity 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
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
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
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
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
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
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
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
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
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
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%
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
MASCOTS 2002 14
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