This is a follow-up to a question I posted earlier about DB Connection Pooling errors in SQLAlchemy.
According to the SQLAlchemy docs the sqlalchemy.pool.QueuePool.__init__()
method takes the following argument:
pool_size – The size of the pool to be maintained, defaults to 5. This is the largest number of connections that will be kept persistently in the pool. Note that the pool begins with no connections; once this number of connections is requested, that number of connections will remain. pool_size can be set to 0 to indicate no size limit; to disable pooling, use a NullPool instead.
What are the drawbacks to setting pool_size=0? What is the benefit of limiting the connection pool size? Is it just to save memory? The database shouldn't really care if a large number of unused connections are open, right?