The JDBC_CONNECTION_RECYCLE_FREQUENCY configuration property determines how often database connections are cleaned up. The minimum value for this property is 15 minutes and the maximum value is 90 days. The value for this configuration property is a time expression, i.e. +15m.
If you are running Flux inside an application server, you can decrease the timeout for your connection pool.