Self-tuning connection pool for SQLAlchemy