How to modify the size of the database connections pool

  • Updated

Objective

Modify the size of the database connections pool used by the Contrast application and modify the corresponding Maximum Connections that the database server can support.

Background

The Contrast application uses a pool of JDBC connections to its database, the size of which defaults to 50. 

In the case of a distributed installation with up to 3 Contrast application servers, the default MySQL database server Maximum Connections of 151 will be sufficient to accommodate this default pool size, however, if additional Contrast application server instances are deployed it will be necessary to modify either or both of the pool size and the database server Maximum Connections to suit.

Process

To modify the size of the JDBC connection pool on a Contrast application server:

Use the Encrypted Properties Editor to edit the database.properties file as follows:

  • To change the size of the JDBC connections pool from the default of 50, add a property named jdbc.maxPoolSize (note that this is case-sensitive).

To modify the Maximum Connections that the MySQL database server can support:

  • Locate the my.cnf file on the MySQL database server (often in the /etc or /etc/mysql folder on Linux distributions).
  • Edit my.cnf and set max_connections to a value that is larger than the combined connection pool sizes on each Contrast application server (for example, for 5 application servers each with a connection pool size of 50, then set max_connections to at least 251).
  • Restart the database server
  •  

Additional Info

The following queries may be useful in verifying the current configuration and status of the database connection pool:

To see the currently configured maximum allowed connections:

mysql> SHOW VARIABLES LIKE "max_connections";

To see the currently connected clients:

mysql> SELECT SUBSTRING_INDEX(host, ':', 1) AS host_short,
  -> GROUP_CONCAT(DISTINCT user) AS users,
-> COUNT(*) AS threads
-> FROM information_schema.processlist
-> GROUP BY host_short
-> ORDER BY COUNT(*), host_short;

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request