noi-techpark / bdp-core

Open Data Hub / Timeseries Core
https://opendatahub.com
Other
9 stars 4 forks source link

As an Open Data Hub maintainer I would like to find out why there are so many open database connections, and possibly find a way to reduce them #264

Closed clezag closed 1 year ago

clezag commented 1 year ago

Both test and production have an excessive number of database connections open at any time (130 and 70 respectively). This is detrimental to database performance and might also lead to discovery of further issues (like containers not shutting down). I would like to investigate where these connections come from and find a way to reduce the count.

clezag commented 1 year ago

So far I've identified two major issues:

  1. in test environment, an old tomcat test server was still running. We stopped it and scheduled it for eventual termination.
  2. Java applications either don't specify any connection pool configuration at all, or specify a fixed maximum of 8 (which in absence of a minimum becomes the constant number). I'm changing the connection pool configuration of the major offenders so that unused connections drop out of the pool after a while
clezag commented 1 year ago

Changed the connection pool configuration of some Java applications to use 1-8 connections instead of 8 fixed.