Connection-concentrator improvements for client connections
The connection concentrator improves the performance of applications that have frequent but relatively transient connections by enabling many concurrent client connections to be processed efficiently. It also reduces memory use during each connection and decreases the number of context switches.
The connection concentrator is enabled when the value of the max_connections database manager configuration parameter is greater than the value of the max_coordagents configuration parameter.
In an environment that requires many simultaneous user connections, you can enable the connection concentrator for more efficient use of system resources. This feature incorporates advantages that were formerly found only in Db2 Connect connection pooling. After the first connection, the connection concentrator reduces the time that is required to connect to a host. When disconnection from a host is requested, the inbound connection is dropped, but the outbound connection to the host is kept within a pool. When a new connection request is received, the database manager attempts to reuse an existing outbound connection from the pool.
For best performance of applications that use connection pooling or the connection concentrator, tune the parameters that control the size of the block of data that is cached. For more information, see the Db2 Connect product documentation.
Examples
- Consider a single-partition database to which, on average, 1000
users are connected simultaneously. At times, the number of connected
users might be higher. The number of concurrent transactions can be
as high as 200, but it is never higher than 250. Transactions are
short.For this workload, you could set the following database manager configuration parameters:
- Set max_coordagents to 250 to support the maximum number of concurrent transactions.
- Set max_connections to AUTOMATIC with a value of 1000 to ensure support for any number of connections; in this example, any value greater than 250 will ensure that the connection concentrator is enabled.
- Leave num_poolagents at the default value, which should ensure that database agents are available to service incoming client requests, and that little overhead will result from the creation of new agents.
- Consider a single-partition database to which, on average, 1000
users are connected simultaneously. At times, the number of connected
users might reach 2000. An average of 500 users are expected to be
executing work at any given time. The number of concurrent transactions
is approximately 250. Five hundred coordinating agents would generally
be too many; for 1000 connected users, 250 coordinating agents should
suffice.For this workload, you could update the database manager configuration as follows:
This means that as the number of connections beyond 1000 increases, additional coordinating agents will be created as needed, with a maximum to be determined by the total number of connections. As the workload increases, the database manager attempts to maintain a relatively stable ratio of connections to coordinating agents.update dbm cfg using max_connections 1000 automatic update dbm cfg using max_coordagents 250 automatic
- Suppose that you do not want to enable the connection concentrator,
but you do want to limit the number of connected users. To limit the
number of simultaneously connected users to 250, for example, you
could set the following database manager configuration parameters:
- Set max_coordagents to 250.
- Set max_connections to 250.
- Suppose that you do not want to enable the connection concentrator,
and you do not want to limit the number of connected users. You could
update the database manager configuration as follows:
update dbm cfg using max_connections automatic update dbm cfg using max_coordagents automatic