|
 |
|
Oracle Concepts - Shared
Pool and Multi-Threaded Server (MTS)
Oracle Tips by Burleson Consulting |
The Shared Pool and MTS
The use of the multi-threaded server option (MTS)
in Oracle requires a sometimes-dramatic increase in the size of the
shared pool. This increase in the size of the shared pool caused by
MTS is due to the addition of the user global areas required for
sorting and message queues. If you are using MTS you should monitor
the V$SGASTAT values for MTS related memory areas and adjust the
shared pool memory allocations accordingly.
Note that in Oracle 8 you should make use of
the large pool feature to pull the user global areas (UGA) and
multi-threaded server queues out of the shared pool area if MTS is
being used. This prevents the fragmentation problems that have been
reported in shared pools when MTS is used without allocating the large
pool. The parallel query option (PQO) in Oracle8 also makes use of the
large pool area, depending on the number of users and degree of
parallel, the large pool may require over 200 megabytes by itself in a
PQO environment.
Large Pool Sizing
Sizing the large pool can be complex. The
large pool, if configured must be at least 600 kilobytes in size.
Usually for most MTS applications 600k is enough. However, if PQO is
also used in your Oracle8 environment then the size of the large pool
will increase dramatically. The V$SGASTAT dynamic performance view has
a new column in Oracle8, POOL. The POOL column in the V$SGASTAT view
is used to contain the pool area where that particular type of object
is being stored. By issuing a summation select against the V$SGASTAT
view a DBA can quickly determine the size of the large pool area
currently being used.
SELECT name,
SUM(bytes) FROM V$SGASTAT WHERE pool='LARGE POOL'
GROUP BY ROLLUP(name);
The above select should be used when an
"ORA-04031:Unable to allocate 16084 bytes of shared memory ("large
pool", "unknown object", "large pool hea", "PX large pool") "
error is received during operation with a large pool configured (the
number of bytes specified may differ). When the above select is run,
the resulting summary number of bytes will indicate the current size
of the pool and show how close you are to your maximum as
specified in the initialization parameter LARGE_POOL_SIZE. Generally
increasing the large_pool by up to 100% will eliminate the ORA-04031
errors.
Oracle8i provides for automated sizing of the
large pool. If PARALLEL_AUTOMATIC_TUNING is set to TRUE or if
PARALLEL_MAX_SERVERS is set to a non-zero value then the
LARGE_POOL_SIZE will be calculated, however, it can be over-ridden
with a manually specified entry in the initialization file. Indeed, if
an ORA-27102: Out of Memory error is received when you set either of
these parameters (or both) you must either manually set
LARGE_POOL_SIZE or reduce the value for PARALLEL_MAX_SERVERS. The
following formula determines the set point for the LARGE_POOL_SIZE if
it is not manually set:
(DOP^2*(4I-1)+2*DOP*3+4*DOP(I-1))*PEMS*USERS
Where:
* DOP – Degree of Parallel calculated from
#CPU/NODE * #NODES
* I – Number of threads/CPU
* PEMS – Parallel execution message size – set
with PARALLEL_EXECUTION_MESSAGE_SIZE initialization parameter, usually
defaults to 2k or 4k but can be larger
* USERS – Number of concurrent users using
parallel query
For a 2k PEMS with 4 concurrent users for a
steadily increasing value for DOP the memory size is a quadratic
function ranging from around 4 meg for 10 CPUs to 120 meg with 70
CPUs. This memory requirement is demonstrated in Figure 15.36.
Figure 8: Example Chart for 2k PEMS and 4
Concurrent Users Showing Memory Requirements as Number of CPUs
Increases
On my NT4.0 Oracle8i, 8.1.3 test system I have
2 CPUs, set at 2 threads per cpu (DOP of 4) and then 4 threads per CPU
(DOP of 8), message buffer of 4k and I performed multiple tests
increasing the PARALLEL_MAX_SERVERS initialization parameter to see
what the resulting increase in LARGE_POOL_SIZE would be, the results
are shown in Table 17.
|
PARALLEL_MAX_SERVERS |
DOP 4 LARGE_POOL_SIZE |
DOP 8 LARGE_POOL_SIZE |
|
4 |
685,024 bytes |
685,024 bytes |
|
8 |
857,056 bytes |
857,056 bytes |
|
16 |
1,151,968 bytes |
1,545,184 bytes |
Table 17: Large Pool Size as a Function of
Parallel Max Servers and DOP
Notice that for a small number of CPUs the
large pool size increase from an increase in parallel max servers
isn't affected by changes in the number of parallel threads until the
value of threads is large in respect to the number of CPUs.
For non-PQO systems a general rule of thumb is
5K of memory for each MTS user for the large pool area.
Guideline 5: In Oracle7when using MTS increase
the shared pool size to accommodate MTS messaging and queuing as well
as UGA requirements. In Oracle8 use the Large Pool to prevent MTS from
effecting the shared pool areas. If using PQO the large pool is
required in Oracle8.
This is an excerpt from
the eBook "Oracle
DBA made Simple".
For more details on Oracle
database administration, see the "Easy
Oracle Jumpstart" by Robert Freeman and Steve Karam. It’s
only $19.95 when you buy it directly from the publisher
here.
|
|
Need an Oracle Health Check?
- Do you have
bad performance after an upgrade?
- Need to
certify that your database follows best practices?
BC Oracle performance gurus can quickly
certify every aspect of your
Oracle database and provide a complete verification that your database
is fully optimized. |

|
|