19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See 4.3, “Monitoring DBM1 storage” on page 157 <strong>for</strong> the contents of the 225 record.<br />

► The DSNZPARM CONTSTOR parameter<br />

The CONTSTOR parameter determines whether or not thread storage contraction is to be<br />

per<strong>for</strong>med. Storage contraction tries to free up allocated storage that is no longer in use by<br />

attempting to contract thread local storage pools at commit. If CONTSTOR is set to YES,<br />

two other thresholds are used to govern when storage contraction is per<strong>for</strong>med <strong>for</strong> a<br />

thread.<br />

– SPRMSTH provides a threshold <strong>for</strong> the amount of storage allocated to a thread be<strong>for</strong>e<br />

contraction occurs.<br />

– SPRMCTH provides a threshold <strong>for</strong> the number of commits per<strong>for</strong>med by a thread<br />

be<strong>for</strong>e contraction occurs.<br />

► The DSNZPARM MINSTOR parameter<br />

The MINSTOR parameter is used to direct <strong>DB2</strong> to use storage management algorithms<br />

that minimize the amount of working storage consumed by individual threads, when <strong>DB2</strong><br />

allocates thread-related storage from local storage pools <strong>for</strong> threads. Essentially, a best fit<br />

storage search algorithm is used instead of a first fit algorithm. The trade-off is less<br />

storage fragmentation however slightly more CPU may be consumed.<br />

MINSTOR should normally be set to its default, NO. However, <strong>for</strong> subsystems that have<br />

many long-running threads and are constrained on storage in the DBM1 address space,<br />

specifying YES may help reduce the total storage used in the DBM1 address space.<br />

► The DSNZPARM MAXKEEPD parameter<br />

The MAXKEEPD parameter indirectly controls the size of the Local Dynamic Statement<br />

Cache, which is allocated at the thread level. MAXKEEPD specifies the total number of<br />

prepared, dynamic SQL statements to be saved past commit. This is a system wide limit,<br />

which is en<strong>for</strong>ced at the thread level when the next commit point is reached <strong>for</strong> the thread.<br />

The Local Dynamic Statement Cache provides <strong>for</strong> prepare avoidance and the Global<br />

Dynamic Statement Cache (now above the bar in V8) provides <strong>for</strong> short prepares. Prepare<br />

avoidance is cheaper than a short prepare, but the cost of a short prepare is much<br />

cheaper (100x) than a typical long prepare.<br />

A suggested tuning approach based on trading CPU <strong>for</strong> virtual storage constraint relief is<br />

to incrementally reduce the size of the Local Dynamic Statement Cache by reducing<br />

MAXKEEPD, even setting it to zero, and then monitor per<strong>for</strong>mance and storage utilization.<br />

You may have to increase the Global Dynamic Statement Cache to compensate, if the<br />

Global Dynamic Statement Cache Hit Ratio starts to deteriorate.<br />

In V7, MAXKEEPD has a default of 5000 statements. As the MAXKEEPD threshold is only<br />

evaluated at commit, it is common to see the number of SQL statements cached exceed<br />

this limit. This is not a problem. For a description of MAXKEEPD at V7 level, see the article<br />

<strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> <strong>OS</strong>/390 Storage Management by John Campbell and Mary Petras, published<br />

in The IDUG Solutions Journal Spring 2000 - Volume 7, Number 1.<br />

► Short prepare per<strong>for</strong>mance enhancement<br />

The short prepare copies a referenced statement from the EDM statement cache pool into<br />

the Local Dynamic Statement Cache and sets it up <strong>for</strong> execution. The overhead varies<br />

depending on the statement execution time but may be 1-2% <strong>for</strong> long running statements.<br />

There is one Local Dynamic Statement Cache pool allocated <strong>for</strong> each thread in <strong>DB2</strong> V7.<br />

This has changed in V8. Now the Local Dynamic Statement Cache is allocated in an array<br />

of 30 global pools. This change should reduce the storage fragmentation below the bar,<br />

however some contention may occur as a result.<br />

The new approach aims to reduce the cost of the <strong>OS</strong> level GETMAINs and FREEMAINs<br />

by going to a centralized storage approach. With this approach, <strong>DB2</strong> uses a number of<br />

146 <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Per<strong>for</strong>mance <strong>Topics</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!