altairbow / django-db-connection-pool

Database connection pool component library for Django
https://pypi.python.org/pypi/django-db-connection-pool/
MIT License
194 stars 24 forks source link

What is the behaviour when set workers and threads using wSGI? #63

Open daviddelucca opened 2 months ago

daviddelucca commented 2 months ago

Hey there!

This is an awesome library that I'm testing to implement into our production environment to solve a lot of connections being open by Django.

For now, it's working smooth and docs are pretty clear, I just have a question about what is the behavior when my gunicorn has the following parameters:

--workers=3
--threads=4

If I had only workers set, the maximum number of connections will not exceed workers pool_size + workers max_pool. But what's happen when set threads?

altairbow commented 1 month ago

The maximum number of connection pools is limited to a single connection pool. Each process will have a separate connection pool. If there is only one process, the total number of database connections will not exceed the maximum limit of the connection pool.