Configure DB connection pool

So far, the connection pool to the database was using the default values
for the maximum number of connections (8). In high traffic situations,
this can negatively affect the plugin performance.

Add a configuration option, maxConnections, to specify the max number of
instances in the connection pool. Other important settings are relative
to this option: the minimum and the maximum number of idle connections
are set to 25% and 50% of maxConnections respectively while the initial
size of the pool is set to the minimal number of idle connections. These
values follow the recommendations stated by one of the contributors [1].

Also, validate the connection instances retrieved from the pool in order
to avoid using closed connections and set the maximum time to wait for a
connection to be retrieved from the pool.

[1] https://www.slideshare.net/psteitz/apachecon2010-pooldbcp

Change-Id: I7ac84b4b5c6f72c3c8726a0d16033b356de0ae75
5 files changed