Siebel Performance Tuning Guide > Tuning the Siebel Application Object Manager for Performance > Configuring Database Connection Pooling for AOMs >
Configuring Pooling for Default Database Connections
Default database connections can be used by most AOM operations.
Configuring Parameters for Pooling Default Connections
This section describes how to enable or disable pooling for default database connections using the parameters MaxSharedDbConns (DB Multiplex - Max Number of Shared DB Connections) and MinSharedDbConns (DB Multiplex - Min Number of Shared DB Connections).
- To enable connection pooling, set MaxSharedDbConns and MinSharedDbConns to positive integer values (at least 1) that are no higher than MaxTasks - 1. A connection will be shared by more than one user session once the number of sessions within the multithreaded process exceeds the maximum number of shared connections allowed per process.
- To configure persistent and shared database connection pooling, set MaxSharedDbConns, using the appropriate ratio of MaxTasks/MaxSharedDbConns. Depending on the ratio, a greater or lesser degree of sharing will be in effect. Start with a 2:1 (or smaller) ratio for MaxTasks/MaxSharedDbConns. With this example ratio, two user tasks will share the same database connection.
- To configure persistent but nonshared database connection pooling, set MaxSharedDbConns = MaxTasks - 1.
- To disable connection pooling, set MaxSharedDbConns and MinSharedDbConns to -1 (this is the default value).
MaxSharedDbConns and MinSharedDbConns are defined per AOM component, on an enterprise basis (these parameters are included in named subsystems of type InfraDatasources). The database connections these parameters control are not shared across multithreaded processes. The actual maximum number of database connections for each multithreaded process is determined by the ratio MaxSharedDbConns/MaxMTServers.
NOTE: MaxSharedDbConns and MinSharedDbConns work differently than MinTrxDbConns, which specifies the number of shared specialized database connections available for each multithreaded process. For details, see Configuring Pooling for Specialized Database Connections.
Example Configuration for Pooling Default Connections
Assume, for example, the following parameter settings:
MaxTasks = 500
MaxMTServers = 5
MinMTServers = 5
MaxSharedDbConns = 250
MinSharedDbConns = 250
With these settings, the AOM component can support a maximum of 500 tasks (threads). Those 500 tasks would be spread over five multithreaded processes, each having 100 tasks. Each multithreaded process would have a maximum of 50 shared database connections, each of which would serve up to two tasks.
How Pooled Default Connections Are Assigned
When a user logs into the AOM, a database connection is established to authenticate the user, then discarded (closed) once the database or external authentication system authenticates the user. After successful authentication, the AOM's connection manager checks the connection pool for SQL statements. If this connection pool is empty, the connection manager adds a connection.
Each time a user initializes a SQL statement, the connection manager checks the connection pool for available connections. The connection manager reserves a connection for the SQL statement in one of the following ways:
- If a connection is available to handle the SQL statement, the connection manager assigns this connection to execute the SQL statement.
The connection manager reserves this connection until execution of the SQL statement terminates. On termination of the SQL statement, the connection manager releases the connection. At the end of a user session (due to a user logging out or session timeout), the connection manager checks the connection used by the user session. If this connection is not referenced by other user sessions and the number of connections available in the pool of database connections exceeds the value specified by MinSharedDbConns, the connection manager closes this connection and releases it from the pool of database connections.
- If no connection is available in the connection pool, the connection manager creates a new connection and assigns it to execute the SQL statement.
The connection manager continues to add connections to the connection pool until the number of connections in the connection pool equals MaxSharedDBConns.