Oracle7 Server Tuning

Contents Index Home Previous Next

Reducing Contention for Multi-Threaded Server Processes

In this section, you will learn how to reduce contention for these processes used by the Oracle's multi-threaded server architecture:

Reducing Contention for Dispatcher Processes

This section discusses these issues:

Identifying Contention for Dispatcher Processes

Contention for dispatcher processes can be reflected by either of these symptoms:

Examining Busy Rates for Dispatcher Processes Statistics reflecting the activity of dispatcher processes are kept in the dynamic performance table V$DISPATCHER. By default, this table is only available to the user SYS and to other users who have SELECT ANY TABLE system privilege, such as SYSTEM. These columns reflect busy rates for dispatcher processes:

IDLE This column shows the idle time for the dispatcher process in hundredths of seconds.
BUSY This column shows the busy time for the dispatcher process in hundredths of seconds.
Monitor these statistics over a period of time while your application is running with this query:

SELECT network                               "Protocol",
      SUM(busy) / ( SUM(busy) + SUM(idle) )  "Total Busy Rate"
   FROM v$dispatcher
   GROUP BY network;

This query returns the total busy rate for the dispatcher processes of each protocol or the percentage of time the dispatcher processes of each protocol are busy. The result of this query might look like this:

Protocol  Total Busy Rate
--------  ---------------
decnet         .004589828
tcp            .029111042

From this result, you can make these observations:

If the dispatcher processes for a specific protocol are busy more than 50% of the time, then you may be able to improve performance for users connected to Oracle using that protocol by adding dispatcher processes.

Examining Wait Times for Dispatcher Process Response Queues Statistics reflecting the response queue activity for dispatcher processes are kept in the dynamic performance table V$QUEUE. By default, this table is only available to the user SYS and to other users who have SELECT ANY TABLE system privilege, such as SYSTEM. These columns show wait times for responses in the queue:

WAIT This column shows the total waiting time in hundredths of seconds for all responses that have ever been in the queue.
TOTALQ This column shows the total number of responses that have ever been in the queue.
Monitor these statistics occasionally while your application is running with this query:

SELECT network     "Protocol",
   DECODE( SUM(totalq), 0, 'No Responses',
      SUM(wait)/SUM(totalq) || ' hundredths of seconds')
   "Average Wait Time per Response"
   FROM v$queue q, v$dispatcher d
   WHERE q.type = 'DISPATCHER'
      AND q.paddr = d.paddr
   GROUP BY network;

This query returns the average time in hundredths of seconds that a response waits in each response queue for a dispatcher process to route it to a user process. This query uses the V$DISPATCHER table to group the rows of the V$QUEUE table by network protocol. The query also uses the DECODE syntax to recognize those protocols for which there have been no responses in the queue. The result of this query might look like this:

Protocol  Average Wait Time per Response
--------  ------------------------------
decnet    .1739130 hundredths of seconds
tcp       No Responses

From this result, you can tell that a response in the queue for DECNET dispatcher processes waits an average of 0.17 hundredths of a second and that there have been no responses in the queue for TCP dispatcher processes.

If the average wait time for a specific network protocol continues to increase steadily as your application runs, you may be able to improve performance of those user processes connected to Oracle using that protocol by adding dispatcher processes.

Adding Dispatcher Processes

You can add dispatcher processes while Oracle is running with the MTS_DISPATCHERS parameter of the ALTER SYSTEM command.

For more information on adding dispatcher processes, see the Oracle7 Server Administrator's Guide.

The total number of dispatcher processes across all protocols is limited by the value of the initialization parameter MTS_MAX_DISPATCHERS. You may need to increase this value before adding dispatcher processes. The default value of this parameter is 5 and the maximum value varies depending on your operating system.

Reducing Contention for Shared Server Processes

This section discusses these issues:

Identifying Contention for Shared Server Processes

Contention for shared server processes can be reflected by steady increase in waiting time for requests in the request queue. Statistics reflecting the request queue activity for shared server processes are kept in the dynamic performance table V$QUEUE. By default, this table is only available to the user SYS and to other users who have SELECT ANY TABLE system privilege, such as SYSTEM. These columns show wait times for requests in the queue:

WAIT This column shows the total waiting time in hundredths of seconds for all requests that have ever been in the queue.
TOTALQ This column shows the total number of requests that have ever been in the queue.
Monitor these statistics occasionally while your application is running with this query:

SELECT DECODE( totalq, 0, 'No Requests',
      wait/totalq || ' hundredths of seconds')
   "Average Wait Time Per Requests"
   FROM v$queue
   WHERE type = 'COMMON';

This query returns the total wait time for all requests and total number of requests for the request queue. The result of this query might look like this:

Average Wait Time per Request
-----------------------------
.090909 hundredths of seconds

From the result, you can tell that a request waits an average of 0.09 hundredths of a second in the queue before it is processed.

You can also determine how many shared server processes are currently running by issuing this query:

SELECT COUNT(*) "Shared Server Processes"
   FROM v$shared_servers
   WHERE status != 'QUIT';

The result of this query might look like this:

Shared Server Processes
-----------------------
                     10

Adding Shared Server Processes

Since Oracle automatically adds shared server processes if the load on existing shared server processes increases drastically, you are unlikely to improve performance simply by explicitly adding more shared server processes. However, if the number of shared server processes has reached the limit established by the initialization parameter MTS_MAX_SERVERS and the average wait time in the requests queue is still increasing, you may be able to improve performance by increasing the MTS_MAX_SERVERS value. The default value of this parameter is 20 and the maximum value varies depending on your operating system. You can then either allow Oracle to automatically add shared server processes or explicitly add shared processes through one of these means:

For more information on adding shared server processes, see the Oracle7 Server Administrator's Guide.


Contents Index Home Previous Next