Tuning Buffer Busy Waits With Freelists
Tuning Buffer Busy Waits With Freelists
Tuning Buffer Busy Waits With Freelists
16/08/2010
TCS Public
Title of the Document
- Note
This document is prepared in a step wise manner rather following general indexing
approach.Because the same can be replicated.
Internal Use 2
Title of the Document
Step 1:-
Step 2:-
Step 4: -
Using the below command I will check the no of freelists
In on the object test.
Step 5:-
I have opened 3 new sessions and placed
The command
SQL>exec testone;
SQL>exec statspack.snap;
Internal Use 3
Title of the Document
In prefsatat user.
Once I have run the above procedure ,I have started
Execute the procedure testone in all the 3 sessions.
Internal Use 4
Title of the Document
Buffer Pool Statistics for DB: SFMS Instance: sfms Snaps: 15 -16
-> Standard block size Pools D: default, K: keep, R: recycle
-> Default Pools for other block sizes: 2k, 4k, 8k, 16k, 32k
Buffer wait Statistics for DB: SFMS Instance: sfms Snaps: 15 -16
-> ordered by wait time desc, waits desc
Internal Use 5
Title of the Document
Avg Wt Wait
Eq Requests Succ Gets Failed Gets Waits Time (ms) Time (s)
-- ------------ ------------ ----------- ----------- ------------- ----------------------
SQ 151,567 151,565 0 100,096 .41 41
HW 2,374 2,374 0 1,435 9.77 14
CF 5,949 5,943 6 30 221.27 7
TX 53,025 53,025 0 33 .48 0
----------------------------------------------------------------------------------------
From the above stataspack report we can observe the Buffer Nowait %
is just 72% ,the Buffer Busy waits in the top 5 wait events and
Buffer Bussy waits in Buffer Pool Statistics.It is clear from the
Buffer wait Statistics the wait is on the datablock..
So,I will just try to increase the freelists of the object test to 3
Since I am executing the same procedure from 3 different sessions
On the same table.
Internal Use 6
Title of the Document
Internal Use 7
Title of the Document
Buffer Pool Statistics for DB: SFMS Instance: sfms Snaps: 17 -18
-> Standard block size Pools D: default, K: keep, R: recycle
-> Default Pools for other block sizes: 2k, 4k, 8k, 16k, 32k
Buffer wait Statistics for DB: SFMS Instance: sfms Snaps: 17 -18
-> ordered by wait time desc, waits desc
Avg Wt Wait
Eq Requests Succ Gets Failed Gets Waits Time (ms) Time (s)
------------------------------------------------------------------------------------------
SQ 257,285 257,285 0 168,992 .46 78
HW 1,254 1,254 0 7 95.86 1
CF 116 116 0 1 16.00 0
TX 90,350 90,350 0 4 .00 0
-----------------------------------------------------------------------------------------
From the above statspack report it shows that the buffer busy waits
were gone.The above report also shows other 2 wait events
enqueue and free buffer waits.Enqueue wait event with SQ reason
is due the oracle sequence.Free buffer waits might be due to
DBWR might not be able to get the free buffers
to write the data.
Internal Use 8
Title of the Document
Conclusion:-
From the above test we came to know how to tune the Buffer Busy Wait caused by the
freelists.The same wait event can also be caused due the the lesser sizing of
the db_cache_size.In that case please monitor the parameter Buffer Busy Nowait,Buffer Hit
Ratio Parameter in the instance ratio’s of statspack report.
Also note that too much increase in the no of freelists may cause the usage
of index costly.Because for each time an insert happens it looks for the block in
the segment free list(May be ITL) since at any time we will have n no of freelists(n is the no
of freelists).Each insert will write data into different block.So when an index
is created on the above columns the clustering_factor(The no of block switches required to
scan a table.Usually a good index will have no of table blocks plus one) may increase
dramtically.Which leads to non usage of index.
Internal Use 9