prprprus / PyMySQLPool

PyMySQL-based database connection pool.
MIT License
60 stars 21 forks source link

resize_pool #5

Closed BrainGithub closed 5 years ago

BrainGithub commented 5 years ago

May I know the static rule, or the Mathematical basis of the resize_pool?? Really appreciate!

BrainGithub commented 5 years ago

I don't know the reason

prprprus commented 5 years ago

Hi, @BrainGithub

There is no esoteric mathematical principle. Just periodically count the ratio between unused list and usage list (count 3 times by default) If exceed the threshold it means that there is too much idle connections then release of some.

I will add more comments and tidy up the code to make the code more readable.😃