Every authentik flow start (browser SSO, LDAP binds, RADIUS/802.1X logins) and RADIUS check_access spends ~0.4 s in PostgreSQL JIT compilation.
JIT off (ak-pg, postgresql.parameters.jit: "off"): the identification stage loads sources with a select_subclasses() join over authentik_core_source and its subclass tables. Most of those tables are empty, the planner assumes 10 pages each, the cost estimate lands far above jit_above_cost (100000), and LLVM compiles 48 functions. Reproduced on ak-pg-2 with EXPLAIN ANALYZE: 425 ms with JIT (413 ms of it JIT), 0.11 ms with SET jit = off, identical plan. ANALYZE does not help (empty tables keep the 10-page assumption). jit is user-settable in CNPG (only jit_provider is fixed) and applies on reload.
Persistent connections (AUTHENTIK_POSTGRESQL__CONN_MAX_AGE=60, AUTHENTIK_POSTGRESQL__CONN_HEALTH_CHECKS=true, global env → server and worker): the default 0 closes the connection after every request; pg_stat_database.sessions grew by ~6.5 connections/s, and catalog index scans outnumbered user-table scans ~12:1 (cache warm-up of fresh backends). No pooler is in the path; connections stay bounded by gunicorn workers/threads, well below max_connections 400.
Expected: the first /api/v3/flows/executor/<flow>/ GET drops from ~270–515 ms to ~100 ms; per 802.1X login the authentik share drops from ~1.05 s by roughly 0.4 s.
Every authentik flow start (browser SSO, LDAP binds, RADIUS/802.1X logins) and RADIUS `check_access` spends ~0.4 s in PostgreSQL JIT compilation.
- **JIT off** (`ak-pg`, `postgresql.parameters.jit: "off"`): the identification stage loads sources with a `select_subclasses()` join over `authentik_core_source` and its subclass tables. Most of those tables are empty, the planner assumes 10 pages each, the cost estimate lands far above `jit_above_cost` (100000), and LLVM compiles 48 functions. Reproduced on `ak-pg-2` with `EXPLAIN ANALYZE`: 425 ms with JIT (413 ms of it JIT), 0.11 ms with `SET jit = off`, identical plan. ANALYZE does not help (empty tables keep the 10-page assumption). `jit` is user-settable in CNPG (only `jit_provider` is fixed) and applies on reload.
- **Persistent connections** (`AUTHENTIK_POSTGRESQL__CONN_MAX_AGE=60`, `AUTHENTIK_POSTGRESQL__CONN_HEALTH_CHECKS=true`, global env → server and worker): the default `0` closes the connection after every request; `pg_stat_database.sessions` grew by ~6.5 connections/s, and catalog index scans outnumbered user-table scans ~12:1 (cache warm-up of fresh backends). No pooler is in the path; connections stay bounded by gunicorn workers/threads, well below `max_connections` 400.
Expected: the first `/api/v3/flows/executor/<flow>/` GET drops from ~270–515 ms to ~100 ms; per 802.1X login the authentik share drops from ~1.05 s by roughly 0.4 s.
References: https://www.postgresql.org/docs/16/jit-decision.html, https://docs.goauthentik.io/install-config/configuration/ (PostgreSQL connection management).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Every authentik flow start (browser SSO, LDAP binds, RADIUS/802.1X logins) and RADIUS
check_accessspends ~0.4 s in PostgreSQL JIT compilation.ak-pg,postgresql.parameters.jit: "off"): the identification stage loads sources with aselect_subclasses()join overauthentik_core_sourceand its subclass tables. Most of those tables are empty, the planner assumes 10 pages each, the cost estimate lands far abovejit_above_cost(100000), and LLVM compiles 48 functions. Reproduced onak-pg-2withEXPLAIN ANALYZE: 425 ms with JIT (413 ms of it JIT), 0.11 ms withSET jit = off, identical plan. ANALYZE does not help (empty tables keep the 10-page assumption).jitis user-settable in CNPG (onlyjit_provideris fixed) and applies on reload.AUTHENTIK_POSTGRESQL__CONN_MAX_AGE=60,AUTHENTIK_POSTGRESQL__CONN_HEALTH_CHECKS=true, global env → server and worker): the default0closes the connection after every request;pg_stat_database.sessionsgrew by ~6.5 connections/s, and catalog index scans outnumbered user-table scans ~12:1 (cache warm-up of fresh backends). No pooler is in the path; connections stay bounded by gunicorn workers/threads, well belowmax_connections400.Expected: the first
/api/v3/flows/executor/<flow>/GET drops from ~270–515 ms to ~100 ms; per 802.1X login the authentik share drops from ~1.05 s by roughly 0.4 s.References: https://www.postgresql.org/docs/16/jit-decision.html, https://docs.goauthentik.io/install-config/configuration/ (PostgreSQL connection management).
🤖 Generated with Claude Code