Keycloak high availability and scaling

Sizing, clustering, database and disaster recovery choices for Keycloak deployments that must stay up under load, based on the architectures the Keycloak project tests.

Keycloak sizing: CPU and memory for your login volume

Turning expected logins, token refreshes and client credentials grants per second into pod CPU and memory, database IOPS and headroom, using the per-request figures from the Keycloak sizing guide and checking them with a load test.

Deploying Keycloak across multiple availability zones

Running one Keycloak cluster across availability zones or data centers: the 10 ms latency limit, synchronously replicated databases such as Aurora PostgreSQL, pod spreading with the Operator, and the outages this design still accepts.

Keycloak multi-cluster active-active deployment (v2)

Building Keycloak across two or more clusters without external Infinispan: the commit latency budget, synchronously replicated database, global load balancer health probes, clock synchronization and the operating runbooks it needs.

Migrating Keycloak multi-cluster v1 to v2

Retiring the external Infinispan cluster of a v1 multi-site deployment: why v1 is deprecated in favor of the stateless feature, the documented migration path to v2, backups to take first and how to test failover after the move.

Keycloak with CloudNativePG PostgreSQL on Kubernetes

Running Keycloak's database on Kubernetes with CloudNativePG as the Keycloak blueprints describe: multi-zone clusters, scheduled S3 backups, monitoring, switchover and recovery, and how it compares with a managed cloud database.

Keycloak database connection pool and thread tuning

Setting the Keycloak database pool and HTTP worker threads for steady latency under load: equal initial, minimum and maximum pool sizes, matching pool size to database limits, and spotting pool exhaustion in metrics.

Keycloak Infinispan cache configuration and tuning

Tuning the embedded Infinispan caches: which caches are local and which distributed, entry limits for realms, users and sessions, sizing for many clients or realms, persistent sessions and cluster discovery with jdbc-ping.

Load testing Keycloak with Keycloak Benchmark

Proving a Keycloak deployment meets its targets before go-live with the project's Gatling-based Keycloak Benchmark: test datasets, login and token scenarios, observability during tests and reading results against the sizing guide.

Keycloak backup and disaster recovery

Planning recovery for an identity outage: what must be backed up (database, configuration, providers and themes), why realm exports are not backups, database backup and restore blueprints, recovery point and time objectives, and DR drills.

Load balancer configuration for a Keycloak cluster

Putting a load balancer in front of Keycloak nodes: even distribution instead of sticky sessions since 26.6, health check endpoints on the management port, TLS re-encryption, timeouts and the paths to expose.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.