Using The Multi-Threaded Server Feature
Using The Multi-Threaded Server Feature
History
Although the MTS feature has been available as a product for some time, it was only in
Oracle8i that it became an integral part of the database, followed by parameter changes
and enhancements in Oracle9i.
What is MTS?
Multi-threaded server, also known as shared server, allows many user processes to share a
few shared server processes to connect to the database. Without MTS, each user process
spawns its own dedicated server process, consuming OS memory. A dedicated server
process remains associated to the user process for the remainder of the connection.
Configuring MTS pre-spawns defined number of dispatcher and shared server processes,
which are used by the user process for database connectivity.
Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=server_name)(Port=1526))
Services Summary...
Service "abc.world" has 1 instance(s).
Instance "abc", status READY, has 50 handler(s) for this service...
Handler(s):
"D049" established:924 refused:0 current:209 max:972 state:ready
DISPATCHER <machine: cceastprod0, pid: 19640>
(ADDRESS=(PROTOCOL=tcp)(HOST=10.174.5.89)(PORT=51919))
Another aspect of implementing MTS is configuring LARGE_POOL area
(LARGE_POOL_SIZE parameter). LARGE_POOL area is basically used to keep session
information and also starting with Oracle9i sorting takes place in LARGE_POOL area.
So as the number of concurrent sessions grows, LARGE_POOL usage grows.
Configuring LARGE_POOL prevents Oracle from using SHARED_POOL to store
session information and avoids shared pool fragmentation.
I have configured LARGE_POOL of size 9 GB, big enough to support large user base
and avoid the ORA-4031 error. The ORA-4031 error prevents new database connections
and it also errors out query executions.
SGA parameters:
db_cache_size = 1536M # 1.5 GB
shared_pool_size = 1717986919 # 1.6 GB
shared_pool_reserved_size = 314572800 # 300 MB
log_buffer = 10485760 # 10 MB
large_pool_size = 9663676416 # 9.0 GB
Performing batch processes
As mentioned earlier, MTS is good for small OLTP transactions and the performance is
slow for batch transactions. There are a few modules in the application that require batch
processing. In such a scenario I use a different database connect string to connect as
DEDICATED session and perform batch execution.
Using SERVER=DEDICATED option in database connect string (tnsnames.ora file)
initiates a DEDICATED connection in MTS environment.
abc.world =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL=TCP) (Host=server_name) (Port=1521)))
(CONNECT_DATA =
(SERVICE_NAME = abc.world)
(SERVER=DEDICATED))
)
Monitoring MTS
There are a couple of things to monitor with respect to MTS:
0. Number of MTS sessions - to check the client sessions growth to configure required
number of shared server and dispatcher processes.
select count(username) "MTS Users"
from v$session
where server <> 'DEDICATED'
/
1. LARGE_POOL usage -
select pool, name, round((bytes/1048576),0) "Free MB"
from v$sgastat
where pool like '%large%'
/
(EXCELLENT)
1
2
3
4
5
Submit a Tip
Digg This! StumbleUpon Del.icio.us
'); // -->
Ads by Google
Oracle
India's largest Jobs and Recruitment Search. Apply Now!
www.TimesJobs.com
Phase Forward
Award-winning EDC solution used in over 3,000 trials worldwide
www.phaseforward.com
Free Tech Information
Browse Our Technology & IT Articles Online. Subscribe to Weekly Report!
www.ITBusinessEdge.com
PL/SQL Developer
Professional PL/SQL Development IDE Trial version available
www.allroundautomations.com
RELATED CONTENT
How can I find statistics on total memory usage and database connections?
RELATED RESOURCES
Search Bitpipe.com for the latest white papers and business webcasts