Settings for Connection Pooling 

Connection pooling improves the performance of requests to the LDAP directory servers. It is a technique used for sharing server resources among requesting clients. Without connection pooling, each request to the LDAP directories causes a new connection to the directory server to be created and then released when the connection is no longer required. The overhead in creating and releasing these connections has adverse effects on performance. With connection pooling, connections are stored in pools after they have been established and are reused for subsequent requests.

In the Enterprise Portal there are 9 connection pools for the LDAP servers:

You can specify the maximum and minimum number of connections in the pool. When the portal requires a connection to the LDAP directories, it attempts to obtain a connection from a corresponding pool. If the pool’s maximum size has been reached and no connection is available after a specified waiting period, the request times out. If a connection in the pool remains unused for a period of time, the connection is destroyed.

A connection can have the following statuses:

The following diagram illustrates which actions are possible on connections:

You can configure all of parameters related to connection pooling in the usermanagement.properties file. The properties are described below. For your changes to the properties file to take effect, you have to restart the Java servlet engine.

 

Connection pool properties in usermanagement.properties

Parameter name

Default value

Description

connectionpool_minsize

1

Minimum number of connections per connection pool. For example, if this value is set to ‘1’, every connection pool will never have less than 1 open connection.

connectionpool_maxsize

10

Maximum number of connections per connection pool. For example, if this value is set to ‘10’, every connection pool is limited to a maximum of 10 connections.

This parameter should be set to the number of concurrent threads that can be processed by the servlet engine in parallel. For example if the servlet engine can process 30 concurrent threads, then this value can be set to 30.

This value also depends on the number of concurrent connections supported by the LDAP server. For example, if the maximum size of the connection pools is set to 10 and there are 9 connection pools, the LDAP server should support at least 90 concurrent connections.

connectionpool_maxidleconnections

5

Maximum number of idle connections per connection pool. If the maximum number of idle connections is reached, every connection pool will close every incoming released connection.

connectionpool_maxidletimemillis

600000

Maximum time in milliseconds for an idle connection in the connection pool. LDAP servers have a parameter that sets the maximum idle time for open connections that are not in use. If this parameter is set to a longer time than on the LDAP server, there will be invalid connections in the connection pools.

connectionpool_maxwaittimemillis

60000

Maximum waiting time in milliseconds if no connection is available. For example, if an application asks the connection pool for a new connection, but all connections are in use, the application will be blocked for as many milliseconds as specified here. If the maximum waiting time is exceeded, a runtime exception is thrown.

connectionpool_monitorintervalmillis

0

Interval in milliseconds at which information is written to the connection pool status log (<1000 means no logging). There is one log file per connection pool and these are available at <Java_iview_runtime>\WEB-INF\plugins\portal\services\usermanagement\data. The connection pool state is represented by: open connections, used connections, idle connections, number of waiting threads.

connectionpool_automaticConnectionReleaseIntervalMillis

300000

Timeout interval in milliseconds for used connections. A connection that is in use longer than the specified number of milliseconds will be ignored by the connection pool (to prevent the connection pools from running out of connections). Applications can perform operations on these connections even if the time has been exceeded, but the connection pool will close the connection as soon it is released by the application.

connectionpool_connectionReleaseCheckIntervalMillis

10000

Frequency of the timeout check for used connections. This parameter specifies how often the list of connections in use is checked for connections that have been in use too long.

 

After you have installed the Enterprise Portal, use the default configuration for the connection pool. Set the property connectionpool_monitorintervalmillis to a high value, so that the state of the connection pools is written to the log files regularly. After the portal has been running for a while, check the log files. If there is a high number of waiting connections, increase the maximum number of connections per pool.