SQLAlchemy pool
-
Use it.
SQLAlchemy
cpool
I'm doing the code:engine = create_engine('mysql://root:root@localhost:3306/DB', pool_size=10,max_overflow=5) dbHandle = engine.connect()
I understand if I use it.
pool_size
, the compounds must be 10 if you seemysql.log
e.g.:26731 Connect root@localhost on DB 26732 Connect root@localhost on DB 26733 Connect root@localhost on DB 26734 Connect root@localhost on DB 26735 Connect root@localhost on DB 26736 Connect root@localhost on DB 26737 Connect root@localhost on DB 26738 Connect root@localhost on DB 26739 Connect root@localhost on DB 26740 Connect root@localhost on DB
Or am I wrong? If I'm wrong, explain how it works.
pool
TotalSQLAlchemy
♪
-
From relevant documentation
QueuePool
: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.
So the set of compounds will grow up
pool_size
and will remain permanent if this number is achieved.