mirror of
https://github.com/suitenumerique/meet.git
synced 2026-10-15 01:13:43 +00:00
e3b6b7e213
Each request opened and closed its own Postgres connection which added a big overhead. The goal is to add Django's native psycopg pool behind a new DB_PSYCOPG_POOL_ENABLED settings with explicit min/max size and keepalive. Each pool lives in one process, and gunicorn's sync workers serve a single request at a time which means that a given worker won't use more than one connection. The default pool minimum size is set to 1, which keeps always one connection open and the maximum size to 3 as headroom for code touching the database from an extra thread. Pooled connections can sit idle for hours, so TCP keepalives are enabled to keep load balancers and NAT from dropping them silently, and each connection is health checked on checkout so a broken one is replaced instead of failing the request.
13 lines
235 B
Plaintext
13 lines
235 B
Plaintext
# Postgresql db container configuration
|
|
POSTGRES_DB=meet
|
|
POSTGRES_USER=dinum
|
|
POSTGRES_PASSWORD=pass
|
|
|
|
# App database configuration
|
|
DB_HOST=postgresql
|
|
DB_NAME=meet
|
|
DB_USER=dinum
|
|
DB_PASSWORD=pass
|
|
DB_PORT=5432
|
|
DB_PSYCOPG_POOL_ENABLED=True
|