Connection pooling options (for DBMS based datastores)
All DBMS based datastores (DB2, Oracle, Postgis, ...) have in common a set of options to tune the pool of connections towards the database.
Pooling connection is an important part of database performance tuning, since getting a connection is usually quite expensive (not so much on MySql, very much so in Oracle, for example): the connection pool is a set of persistently held database connection.
The pool needs to be carefully tuned, it must not be too small nor too big, otherwise scalability and performance will suffer. Finding the right size of the connection pool is matter of making some scalability tests (for example, using JMeter, since the proper size is very much dependent on how fast the hardware and the network are.
The options controlling the connection pool are:
| Option name | Description |
|---|---|
| max connections | Maximum number of connection the pool can hold. When the maximum number of concurrent connections is reached the clients will have to wait for a connection to be freed, so this effectively limits the number of concurrent requests doing actual work agains the DBMS in GeoServer |
| min connections | The minimum number of connections that will persistently held, even when there are no active requests. This should be sized big enough to address the expected light load of the server, since once the min connections are saturated, more connections will be opened and the price to open them will be paid |
| validate connections | Pooled connections may become invalid for a number of reasons, for example because of a network breakdown, or because the database server is configured with timeouts. Activating "validate connection" will make GeoServer check the connection is still good before using it to serve a request. The downside is that the check requires a quick query to be made against the DBMS server, so a performance price will be paid. For maximum performance, keep this disabled and make sure the connections cannot expire, for example by placing the DBMS on the same machine as GeoServer and by disabling connection timeouts |