Creating or opening database connections can be very time-consuming with respect to application functionality. Each connection can require establishing a socket communication, providing authentication, and starting transaction boundaries.
To help ensure that this process is as efficient as possible, all xMatters applications (including the database) use 'connection pooling', which is a cache of reusable database connections. This is a common strategy for many enterprise applications. Connection pooling controls the costs associated with creating connections by reusing connections and reducing connections. All xMatters' applications use an open source library called C3P0 for this purpose.
NOTE: this article is meant to supplement the section titled "Configuring database connection pools for separate xMatters components" in the xMatters installation and administration guide. Refer to that section for information about settings and where you can change them for each component.
Managing Pool Size and Connection Age
C3P0 offers a wide variety of options for controlling how quickly pools that have grown large under load revert tominPoolSize, and whether 'old' connections in the pool should be proactively replaced to maintain their reliability.
By default, xMatters will expire connections over time to maintain 'freshness'. The maxIdleTime defines how many seconds a connection should be permitted to go unused before being culled from the pool; typically this is set to 1800 seconds (30 minutes). In addition, any connections above the minimum set value will be released after they have been idle for the maxIdleTime. This is important so that unnecessary connections are released after a spike in usage that forces a large pool size.
IMPORTANT: In general, keep in mind when working with these timeout parameters that there is no need to work through all connections every few seconds. The point of connection pooling is to bear the cost of acquiring a connection only once, and then to reuse the connection repeatedly. Most databases support connections that remain open for hours at a time.
The typical out-of-box xMatters connection pool configuration is as follows:
Web User Interface
Originally created by Cameron Stewart