Since we usually peak briefly, we will fork a lot of PostgreSQL
processes that we will never need again. In order to avoid wasting too
much memory, we close those connections quicker, but at least 8 open so
that new tasks will quickly be able to acquire a database connection.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
configure=self.__configure,
# Set limits for min/max connections in the pool
- min_size=4,
+ min_size=8,
max_size=128,
# Give clients up to one minute to retrieve a connection
timeout=60,
- # Close connections after they have been idle for one minute
- max_idle=60,
+ # Close connections after they have been idle for 15 seconds
+ max_idle=15,
)
def __configure(self, conn):