See “The Program Interface” on page 5-41 for additional information about the
program interface.
The Multi-Threaded Server
The multi-threaded server configuration allows many user processes to share
very few server processes. Without the multi-threaded server configuration,
each user process requires its own dedicated server process; a new server
process is created for each client requesting a connection. A dedicated server process remains associated to the user process for the remainder of the
connection. With the multi-threaded server configuration, many user
processes connect to a dispatcher process. The dispatcher routes client
requests to the next available shared server process. The advantage of the
multi-threaded server configuration is that system overhead is reduced, so the number of users that can be supported is increased.
Contrasting Dedicated Server Processes and Shared Server Processes
Consider an order entry system with dedicated server processes. A customer
places an order as a clerk enters the order into the database. For most of the transaction, the clerk is on the telephone talking to the customer and the server process dedicated to the clerk’s user process remains idle. The server process is not needed during most of the transaction, and the system is slower for other clerks entering orders.
The multi-threaded server configuration eliminates the need for a dedicated
server process for each connection. A small number of shared server processes
can perform the same amount of processing as many dedicated server
processes. Also, the amount of memory required for each user is relatively
small. Because less memory and process management are required, more
users can be supported.
An Overview of the Multi-Threaded Server Architecture
The following types of processes are needed in a system using the multi-
threaded server architecture:
•
a network listener process that connects user processes to dispatchers
and dedicated servers (this process is part of Net8, not Oracle).
•
one or more dispatcher processes
5-34 Oracle8 Server Concepts
•
one or more shared server processes
The network listener process waits for incoming connection requests and
determines if each user process can use a shared server process. If so, the
listener gives the user process the address of a dispatcher process. If the user process requests a dedicated server, the listener process creates a dedicated
server process and connects the user process to it. (At least one dispatcher
process must be configured and started per network protocol that the database
clients will use.)
Note: To use shared servers, a user process must connect through Net8, even if the user process is on the same machine as the Oracle instance.
A request from a user is a single program interface call that is part of the user’s SQL statement. When a user makes a call, its dispatcher places the request on
the request queue in the SGA, where it is picked up by the next available
shared server process. The shared server processes make all the necessary calls to the database to complete each user process’s request. When the server
completes the request, the server returns the results to the response queue of the dispatcher that the user is connected to the SGA. The dispatcher then
returns the completed request to the user process.
In the order entry system example, each clerk’s user process connects to a
dispatcher; each request made by a clerk is sent to a dispatcher, which places the request in the request queue. The next available shared server process
picks up the request, services it, and puts the response in the response queue.
When a clerk’s request is completed, the clerk remains connected to the
dispatcher, but the shared server process that processed the request is released and available for other requests. While one clerk is talking to a customer, not making a request to the database, another clerk can use the same shared server process.
Figure 5-9 illustrates how user processes communicate with the dispatcher
across the two-task interface and how the dispatcher communicates users’
requests to shared server processes.
Memory Structures and Processes 5-35
Figure 5-9: The Oracle Multi-Threaded Server Configuration and Shared Server Processes
Process
Application
Code
7
Client Workstation
1
Database Server
Dispatcher Processes
6
Shared
Server
Processes
Oracle
Server Code
3
4
System Global Area
2
5
Request
Response
Queues
Queues
Shared Server Processes
Shared server processes and dedicated server processes provide the same
functionality, except shared server processes are not associated with a specific user process. Instead, a shared server process serves any client request in the multi-threaded server configuration.
5-36 Oracle8 Server Concepts
The PGA of a shared server process does not contain user-related data; such information needs to be accessible to all shared server processes. The PGA of
a shared server process contains only stack space and process-specific
variables. “Program Global Area (PGA)” on page 5-26 provides more
|