Connection Pool Configuration

The ExtraView application manages many different users, each of whom may be performing many different tasks by communicating to the back-end database via a utility called a connection pool.

Making a connection to the underlying database from the Java language consumes a significant amount of processing time. ExtraView uses the Connection Pool to manage and optimize this connection and ensure that this is as efficient as possible.

Many of the parameters used in managing the connection pool are configurable.

When a new database connection is established, these parameters set up the initial working, and ensure that a minimum number of connections are made and are instantly available.

As ExtraView usage increases the size of the pool increase dynamically, and without any need for the system administrator to make adjustments. As the usage decreases over time the size of the connection pool will shrink down to the minimum. Upon periods of extended inactivity, connections may time out but no new connections will be made until a new request from ExtraView is made.

One major advantage of ExtraView using its own internal connection pool manager is that if the connection to the database is disrupted for any reason, such as a network or database failure, then ExtraView will rebuild the connections when the service is restored. In most cases, users will therefore not experience any loss of their sessions with such a failure. This greatly outweighs using any other connection pool software, such as that shipped with some application servers.

The connection pool is typically configured when ExtraView is first installed, and unless dramatic changes take place in the usage, these will not need further adjustment. The configuration of the parameters for the connection pool manager takes place within the file named WEB-INF/configuration/Configuration.properties. The default parameters look like this:

# Connection pool settings
ConnectionPoolSize = 20
ConnectionPoolMax = 200
ConnectionUseCount = 500
ConnectionTimeout = 10
ConnectionPoolTimeout = 20

Parameters

ConnectionPoolSize This is a minimum size of the pool. Upon creation this is how many connections are made. The default value is 20 connections.
ConnectionPoolMax The number of connections the pool can grow to. If and when this number is reached no more connections will be created. If more connections are requested from this point, a null connection will be passed out.

Fundamentally, when the maximum number of connections is reached, and a user makes a request, the request will wait for an existing connection to become available before progressing.

ConnectionUseCount This is the number of times a connection will be used. After this many times the connection is closed and a new one is created. This keeps any connection from having a memory leak or some other problem and this problem persisting through time.
ConnectionTimeout This is a period in minutes. If a connection is not used for this amount of time it is closed and a new one is created when a new request occurs. This keeps any existing connection from becoming stale for any reason.
ConnectionPoolTimeout This is a period in minutes. This measures the amount of time the connection pool goes without receiving any requests. After this time, the pool will not make a new connection when connections time out. When the next request comes in the pool will again create the minimum number of connections, and then pass out the connection.

Monitoring the Connection Pool

A servlet named ConnectionPoolMon is installed along with ExtraView. This displays the current usage of the connection pool, as seen in the following screenshot.

Displayed is the current usage, refreshing every few seconds. This can be used to optimize the settings. To see the connection pool monitor, use a URL similar to the following, using your own domain information:

http://www.mycompany.com/evj/ConnectionPoolMon