config(authentik): optimize DB connections and worker scaling

- Replace USE_PGBOUNCER with CONN_MAX_AGE=0 and CONN_HEALTH_CHECKS
- Reduce web workers to 1 with 2 threads (homelab scale)
- Update worker config: CONCURRENCY=1, THREADS=2
- Remove redundant Redis config from worker service

Reduces overall PostgreSQL connection count.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-06 12:42:04 +01:00
co-authored by Claude Opus 4.5
parent 6052f81ec1
commit d3400fb622
+10 -7
View File
@@ -31,7 +31,12 @@ services:
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__USER: authentik_user
AUTHENTIK_POSTGRESQL__PASSWORD: F//j0ktck7cX06Vfgh0YXceONOtlSsHvadqROICeDx8=
AUTHENTIK_POSTGRESQL__USE_PGBOUNCER: false
AUTHENTIK_POSTGRESQL__CONN_MAX_AGE: 0
AUTHENTIK_POSTGRESQL__CONN_HEALTH_CHECKS: true
# Worker scaling (reduced to limit DB connections)
AUTHENTIK_WEB__WORKERS: 1
AUTHENTIK_WEB__THREADS: 2
# Secret key (generated: openssl rand -base64 32)
AUTHENTIK_SECRET_KEY: TnFaTZ//RDcO2hxVR4QGOBORd5tfXe4Vok+lcAz/AdE=
@@ -90,18 +95,16 @@ services:
AUTHENTIK_POSTGRESQL__NAME: authentik
AUTHENTIK_POSTGRESQL__USER: authentik_user
AUTHENTIK_POSTGRESQL__PASSWORD: F//j0ktck7cX06Vfgh0YXceONOtlSsHvadqROICeDx8=
AUTHENTIK_POSTGRESQL__USE_PGBOUNCER: false
AUTHENTIK_REDIS__HOST: redis-shared
AUTHENTIK_REDIS__PORT: 6379
AUTHENTIK_REDIS__DB: 0
AUTHENTIK_POSTGRESQL__CONN_MAX_AGE: 0
AUTHENTIK_POSTGRESQL__CONN_HEALTH_CHECKS: true
AUTHENTIK_SECRET_KEY: TnFaTZ//RDcO2hxVR4QGOBORd5tfXe4Vok+lcAz/AdE=
AUTHENTIK_LOG_LEVEL: warning
AUTHENTIK_ERROR_REPORTING__ENABLED: false
TZ: Europe/Amsterdam
# Worker-specific configuration
AUTHENTIK_BOOTSTRAP_WORKERS: 1 # Single worker (homelab scale)
AUTHENTIK_WORKER__THREADS: 2 # 2 threads per worker
AUTHENTIK_WORKER__CONCURRENCY: 1
AUTHENTIK_WORKER__THREADS: 2
volumes:
- /home/jpmschweitzer/docker-data/authentik/media:/media