MERCADOS FINANCIEROS

miércoles, 4 de noviembre de 2020

Configuring Multi-Threaded Server

 

Setting the Initial Number of Dispatchers

The number of dispatchers started at instance startup is controlled by the DISPATCHERS attribute.


Note:

Unlike the shared servers, the number of dispatchers does not change dynamically. The number of dispatchers must be explicitly changed with the ALTER SYSTEM command. You can change the number of dispatchers in this manner up to a maximum limit specified by the MTS_MAX_DISPATCHERS parameter. See the Oracle8i Designing and Tuning for Performance for further information about this parameter. 


The appropriate number of dispatchers for each instance depends upon the performance you want from your database, the host operating system's limit on the number of connections per process, (which is operating system dependent), and the number of connections required per network protocol.

Calculating the Initial Number of Dispatchers

Once you know the number of possible connections per process for your operating system, calculate the initial number of dispatchers to create during instance startup, per network protocol, using the following formula.

number                 maximum number of concurrent sessions
of           = CEIL   (--------------------------------------------------------------------------)
dispatchers                connections per dispatcher

CEIL represents the number roundest to the next highest number.

As an example, assume that a system that has:

  • 4000 users concurrently connected via TCP/IP and supports 1,000 connections per process

  • 3000 users concurrently connected via SPX and supports 1,000 connections per process

In this case, the DISPATCHERS attribute for TCP/IP should be set to a minimum of four dispatchers and SPX should be set to a minimum of three dispatchers:

mts_dispatchers="(protocol=tcp)(dispatchers=4)(connections=1000)"
mts_dispatchers="(protocol=spx)(dispatchers=3)(connections=1000)"

Depending on performance, you may need to adjust the number of dispatchers.

Setting Dispatcher Addresses

Example 1

To force the IP address used for the dispatchers, set the following:

mts_dispatchers="(address=(protocol=tcp)(host=144.25.16.201))
(dispatchers=2)"

This starts two dispatchers that listen on HOST=144.25.16.201. Note that Net8 dynamically selects the TCP/IP port for the dispatcher.

Example 2

To force the exact location of the dispatchers, add the PORT as follows:

mts_dispatchers="(address=(protocol=tcp)
(host=144.25.16.201)(port=5000))(dispatchers=1)"
mts_dispatchers="(address=(protocol=tcp)
(host=144.25.16.201)(port=5001))(dispatchers=1)"

Note:

You can specify multiple MTS_DISPATCHERS in the initialization file, but they must be adjacent to each other.  


Enabling Connection Pooling

Connection pooling is a resource utilization feature that enables you to reduce the number of physical network connections to a dispatcher. This is achieved by sharing or pooling a set of connections among the client processes.

To configure connection pooling, set the MTS_DISPATCHERS parameter in the initialization parameter file with the POOL attribute and the following optional attributes:

Returning to the example in "Calculating the Initial Number of Dispatchers", connection pooling can be used to allow each dispatcher 1,000 connections and 4,000 sessions for TCP/IP and 3,000 sessions for SPX. This reduces the configuration to one dispatcher for each protocol, as shown in the following:

mts_dispatchers="(protocol=tcp)(dispatchers=1)(pool=on)(tick=1) (connections=1000)(sessions=4000)"

mts_dispatchers="(protocol=spx)(dispatchers=1)(pool=on)(tick=1) 
(connections=2000)"

Allocating Resources

An Oracle8i database can be represented by multiple service names. Because of this, a pool of MTS dispatchers can be allocated exclusively for clients requesting a particular service. This way, the mission critical requests may be given more resources and, thus, in effect increase their priority.

For example, the following initialization parameter file sample shows two dispatchers. The first dispatcher services requests for clients requesting sales.us.acme.com. The other dispatcher services requests for only clients requesting adminsales.us.acme.com.

service_names=sales.us.acme.com
instance_name=sales
mts_dispatchers="(protocol=tcp)" 
mts_dispatchers="(protocol=tcp)(service=adminsales.us.acme.com)" 

Using MTS on Clients

If MTS is configured and a client connection request comes when no dispatchers are registered, the requests can be handled by a dedicated server (configured in the listener.ora file). If you want a particular client to always use a dispatcher, configure (SERVER=SHARED) in the connect data portion of the connect descriptor. For example:

sales= 
(description= 
  (address=(protocol=tcp)(host=sales-server)(port= 1521))
  (connect_data=
     (service_name=sales.us.acme.com)
     (server=shared)))

No hay comentarios: