Skip to content

Keep one connection in the DB pool

akwizgran requested to merge limit-connection-pool-size into master

This branch limits the number of idle connections in the DB's connection pool to 1. No limit is imposed on the number of connections that can be open at any given time, but all except one of the unused connections will be closed when they're no longer being used.

H2 closes the database when the last connection is closed, so keeping one connection open avoids slowdowns caused by repeatedly opening and closing the DB.

This may help to save memory by releasing unused connections after a period of heavy DB activity that briefly uses many parallel connections (eg app startup, or uploading a group message to many contacts' mailboxes at once). Without this change, all the connections would be kept open indefinitely.

I've been running this branch without issue for a month.

Merge request reports