oracle rdb buffering a comparative studydownload.oracle.com/.../rdb/pdf/rdbtf05_buffering.pdf ·...
TRANSCRIPT
3
Test Case
• Multi-user test• Rdb V7.1-401• Modified MF_PERSONNEL database• Three users reading, inserting, deleting in
EMPLOYEES table• Short Transactions• Results varied a bit from one run to the next
• Standalone ES40 with HSG80• VMS V7.3-2• No other users• Not clustered
4
Effects of Number of Buffers
• More buffers increases the chance thatrecently accessed pages will still be inmemory
• More buffers require more overhead tomanage
• More pages in memory increase chances oflock conflicts and deadlocks
5
Local Buffers With XFC vsGlobal Buffers Without XFC
• By sharing a common buffer pool manyprocesses can take advantage of the I/Odone by a single process
• Keeping unreferenced data in memory savesI/O if referenced again
• Rdb global buffers and XFC have similargoals
6
Effects of Number of BuffersI/O for Local vs Global Buffers
0
50000
100000
150000
200000
250000
300000
20 80 320
1280
5120
Buffers
I/Os LB I/O
GB I/O
7
Effects of Number of BuffersCPU Time
0
5
10
15
20
25
30
35
20 80 320
1280
5120
Buffers
CP
U S
eco
nd
s
LB XFC CPUSeconds
GB CPU Seconds
8
Effects of Number of BuffersElapsed Time
0
20
40
60
80
100
120
140
160
20 80 320
1280
5120
Buffers
Ela
pse
d S
eco
nd
s
LB XFC ElapsedSeconds
GB ElapsedSeconds
9
Effects of Different FeaturesLocal / Global Buffers, XFC
320 Buffers
0
5
10
15
20
LBXFC
LB noXFC
GBXFC
GB noXFC
CPU Seconds
0
20
40
60
80
100
120
LBXFC
LB noXFC
GBXFC
GB noXFC
Elapsed Seconds
10
The Quest for More Buffers
• Shared Memory is System – takes virtual addressspace from system (S0) address space
• Global Buffers in VLM (“large memory isenabled”) – puts global buffers in Rdb’simplementation of extended memory
• Get buffers out of P0 address space – reduceVASFULL errors
• Makes buffers memory resident – less pagefaulting
11
Effects of Different FeaturesSMS, GB VLM
0
5
10
15
20
LB XFC GB noXFC
SMS GB VLM
CPU Seconds
0
20
40
60
80
100
120
LB XFC GB noXFC
SMS GB VLM
Elapsed Seconds
320 Buffers
12
Effects of Different FeaturesFast Commit
• Don’t write modified pages to disk at theend of every transaction
• If a failure occurs before modified pagesfrom a committed transaction are written todisk then those pages are rebuilt from thejournal
• Can increase page lock conflicts• Typically reduces/eliminates RUJ writes
13
Effects of Different FeaturesOPT
• Ownership of “hot” pages that are oftenmodified by many processes are passedbetween processes without first beingwritten to disk
14
Effects of Different FeaturesFast Commit and OPT
320 Buffers
0
20
40
60
80
100
120
LB XFC GB OPT LB FC XFC
Elapsed Seconds
0
10000
20000
30000
40000
50000
60000
70000
LB XFC GB OPT LB FC XFC
Data Writes
15
Effects of Different FeaturesRow Cache
• Row cache copies referenced rows fromdisk data pages into an in-memory cache
• Once a cache is loaded little read I/O isneeded
• With “snapshots in cache” enabled manywrites can be avoided
• Reduces page lock contention• Requires more expertise to setup
16
Effects of Different FeaturesRow Cache
020406080
100120140
LB XFC GB OPT LB FCXFC
LB RC FC
Elapsed Seconds
320 Buffers
17
Effects of ContentionLock Conflicts and Deadlocks
• If there is a lock conflict on a table or rowlock then all buffers are flushed anddemoted
• VMS waits DEADLOCK_WAIT secondsbefore checking for deadlocks
18
After-Image Journaling(AIJ Writes)
• Always enable ALS• Does double buffering• Less AIJ lock contention• Better tuned for group writes
19
Before-Image Journaling(RUJ Writes)
• RUJ buffers must be flushed before databuffers are flushed – synchronous write
• Lock conflicts cause data buffers (and thusRUJ buffers) to be flushed
• If Fast Commit is enabled then RUJ flushesare often avoided
• Larger ABW batches allow larger RUJbatches and thus fewer RUJ writes
20
Summary
• XFC works great! May be better than globalbuffers
• XFC and global buffers are redundant• Don’t skimp on buffers• Fast commit can significantly reduce writes• Row cache prevents I/O and lock conflicts• Beware of contention• Always enable ALS• Experiment to see what works best for you
21
For More Information
• www.oracle.com/rdb• metalink.oracle.com• www.hp.com/products/openvms• [email protected]• [email protected]