We are using GeoServer with a geoserver cache for some layers. Most of our layer updates frequently and therefore we do not want to setup a cache for them (they do have in memory cache though).
First, we use different workspaces for different types/actions we want to perform and want to keep the different workspaces/layers separate, however they all connect to the same PostGIS database.
Now I am facing a problem where we have 15+ workspaces, each workspace has a connection pool (default 10) to the same PostGIS DB. So that means that our GeoServer instance is taking more connections that PostGIS has (100), also we do have other applications running on the same database.
The connection pool for each store has a max connections = 10, min connections=1, connection timeout = 10, evictor run periodcity = 30, max connection idle time = 30, evictor tests per run = 3.
I noticed that PostGIS has a lot of connections on idle and does not close them. What is the best way of connection GeoServer to a PostGIS database with the minimum connections? How can I force the idle connections to close without changing the max connections?