--- title: otp session benchmark of zitadel v4.17.1 sidebar_label: otp session --- import OutputSource from "./output.json"; import { BenchmarkChart } from "@/components/benchmark_chart"; Benchmark results of the v4.17.1 release of Zitadel. ## Performance test results | Metric | Value | | :------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Baseline | none | | Purpose | Test current performance | | Test start | 2026-08-27 18:49:09 UTC | | Test end | 2026-08-27 19:19:16 UTC | | Test duration | 30min | | Executed test | otp_session | | k6 version | v2.1.0 | | VUs | 600 | | Client location | US1 | | ZITADEL location | US1 | | ZITADEL container specification | vCPU: 6
Memory: 6 Gi
Container min scale: 7
Container max scale: 7 | | ZITADEL Version | v4.17.1 | | ZITADEL Settings | Eventstore autovacuum (new in v4.17): Enabled: true
VacuumThreshold: 1000000
AnalyzeThreshold: 1000000
Tuned for the ~4,000 events/s expected during the benchmark, per the [tuning guide](https://zitadel.com/docs/self-hosting/manage/tuning#reading-events). | | ZITADEL feature flags | Enabled: loginDefaultOrg (instance), oidcTokenExchange (system), enableBackChannelLogout (system), consoleUseV2UserApi (instance)
improvedPerformance (instance): IMPROVED_PERFORMANCE_PROJECT_GRANT, IMPROVED_PERFORMANCE_PROJECT, IMPROVED_PERFORMANCE_USER_GRANT, IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED
Disabled: loginV2 (explicitly false at instance), userSchema, debugOidcParentError, oidcSingleV1SessionTermination, permissionCheckV2
Captured from the instance **before** the run (sequence 7, set 2026-08-27 13:35:31 UTC); the same capture covers `manipulate_user` at 13:41 and the rest of the sweep from 14:56, so all eleven targets ran the same configuration.
This restores like-for-like comparison with the v4 pages, which ran five improvedPerformance options. The fifth, IMPROVED_PERFORMANCE_ORG_BY_ID, is `reserved` in the proto and no longer exists. | | Database | type: psql
version: v17.4 | | Database location | US1 | | Database specification | vCPU: 8
memory: 32Gib | | ZITADEL metrics during test | CPU: p50 9%, p99 20% (peak 22%)
Memory: p50 6%, peak 14%
Instances: 7 (constant), no container startups recorded
Server-side: 256 req/s, latency p50 2.8s / p95 8.4s / p99 9.3s | | Observed errors | 182 of 466,756 requests failed (0.03%): none of the 182 individually logged (see k6 output). 182 of 466,159 checks failed (0.03%): add Session status ok (56 failed), set Session status ok (126 failed) | | Top 3 most expensive database queries | 1: Projection handler advisory lock, one per projection per instance — **lock wait, not query work** (13,149 s)
2: Query events by instance_id, aggregate_types, event_types, position (paged) (3,760 s)
3: Load user with primary login name and human profile (1,615 s)
Ranked by total accumulated execution time summed across concurrent sessions (Cloud SQL Query Insights) — not CPU time; it can exceed the wall-clock window. | | Database metrics during test | CPU: 63% median, 64% peak
Memory: 40%
Connections: 46
Transactions: 3,554/s
IOPS: read 3, write 860 | | k6 Iterations per second | 84 | | k6 output | [output](#k6-output) | | flowchart outcome | **Potential issues.** Not resource-bound: database CPU 63%, ZITADEL CPU 9%, yet **69% of the top-5 query time is advisory lock wait** — predominantly the projection handler lock, which serialises this workload. Additional vCPU will not help. Logged as an issue rather than blocking further scale testing. | ## Endpoint latencies ## k6 output ```bash █ TOTAL RESULTS checks_total.......: 466159 252.308936/s checks_succeeded...: 99.96% 465977 out of 466159 checks_failed......: 0.03% 182 out of 466159 ✓ user defined ✓ authorize status ok ✓ login name status ok ✓ login shows password page ✓ password status ok ✓ password callback ✓ code set ✓ token status ok ✓ access token created ✓ id token created ✓ info created ✓ org created ✓ create user is status ok ✓ set email otp status ok ✗ add Session status ok ↳ 99% — ✓ 154981 / ✗ 56 ✗ set Session status ok ↳ 99% — ✓ 309783 / ✗ 126 ✓ org removed CUSTOM login_ui_enter_login_name_duration...: min=111.91ms avg=111.91ms max=111.91ms p(50)=111.91ms p(95)=111.91ms p(99)=111.91ms login_ui_enter_password_duration.....: min=19.51ms avg=19.51ms max=19.51ms p(50)=19.51ms p(95)=19.51ms p(99)=19.51ms login_ui_init_login_duration.........: min=72.77ms avg=72.77ms max=72.77ms p(50)=72.77ms p(95)=72.77ms p(99)=72.77ms login_ui_token_duration..............: min=112.4ms avg=112.4ms max=112.4ms p(50)=112.4ms p(95)=112.4ms p(99)=112.4ms org_create_org_duration..............: min=57.4ms avg=57.4ms max=57.4ms p(50)=57.4ms p(95)=57.4ms p(99)=57.4ms otp_session_duration.................: min=125ms avg=6.97s max=36.37s p(50)=5.63s p(95)=18.87s p(99)=23s session_add_session_duration.........: min=52.96ms avg=6.77s max=30.32s p(50)=5.35s p(95)=18.76s p(99)=22.29s session_set_session_duration.........: min=20.57ms avg=96.93ms max=8.56s p(50)=39.41ms p(95)=64.73ms p(99)=2.29s set_human_email_otp_duration.........: min=27.64ms avg=241.81ms max=549.68ms p(50)=256.75ms p(95)=481.96ms p(99)=535.73ms user_create_human_duration...........: min=378.51ms avg=3.51s max=6.81s p(50)=3.82s p(95)=5.86s p(99)=6.72s HTTP http_req_duration....................: min=17.42ms avg=2.32s max=30.32s p(50)=47.8ms p(95)=13.83s p(99)=20.22s { expected_response:true }.........: min=17.42ms avg=2.32s max=30.32s p(50)=47.79ms p(95)=13.83s p(99)=20.22s http_req_failed......................: 0.03% 182 out of 466756 http_reqs............................: 466756 252.632063/s EXECUTION iteration_duration...................: min=124.68ms avg=6.97s max=36.37s p(50)=5.62s p(95)=18.86s p(99)=23s iterations...........................: 155037 83.913902/s vus..................................: 0 min=0 max=600 vus_max..............................: 600 min=600 max=600 NETWORK data_received........................: 351 MB 190 kB/s data_sent............................: 178 MB 96 kB/s running (30m47.6s), 000/600 VUs, 155037 complete and 0 interrupted iterations default ✓ [ 100% ] 600 VUs 30m0s ```