PTF- Testing folio-keyclock cluster mode

PTF- Testing folio-keyclock cluster mode




Overview

This test aims to validate the stability and High Availability (HA) capabilities of the folio-keycloak module running in clustered mode. Specifically, we are testing the transition from the custom JDBC_PING2 discovery protocol to the standard jdbc-ping. This is an experimental and regression test utilizing an unreleased folio-keycloak image built from a development branch.

The testing will be conducted on the MOBIUS environment, configured with 60 tenants and the MOBIUS dataset, to simulate a realistic multi-tenant Keycloak/Eureka architecture.

Testing Goals:

  • Baseline Establishment: Run a mixed-workload scenario (Authorization and roles creation) on the existing JDBC_PING2 setup to capture baseline metrics.

  • A/B Comparison: Deploy the custom branch (KEYCLOAK-111) with jdbc-ping and execute the same load. The goal is to verify cluster mode stability, confirm the new mechanism is active, and ensure no undesirable side effects are introduced.

  • Failover & Scaling Verification: Observe how Keycloak behaves during dynamic scaling under load. This includes scaling up (adding nodes), scaling down (gracefully removing nodes), and failover testing (forcefully stopping/killing nodes) to verify HA functionality.

Defined SLAs:

  • Performance: 0 regression. Response times (RT) with the new jdbc-ping configuration must not degrade compared to the baseline.

  • Failover Reliability: Aiming for zero dropped connections (0% errors) or minimal, acceptable momentary spikes in 5xx errors/RT during container termination and cluster recovery.

Jira Ticket: https://folio-org.atlassian.net/browse/PERF-1387

 

Summary

  1. High Availability (HA) & Failover: During the dynamic scaling and failover tests, the jdbc-ping cluster met the SLA. When forcefully terminating a Keycloak node, the system recovered successfully, resulting in an error rate of 0% before traffic.

  2. In test 2,3,4,5 Folio-keycloak works in cluster mode as expected.

  3. Error rate were 0% in all FailOver tests.

  4. We conducted three test runs for each configuration and analyzed the results. The requirement of 0 regression was met. The implementation of the Keycloak-111 branch introduces no systemic degradation to response times. Furthermore, high-volume core transactions demonstrated noticeable improvements in both average response times and 90th percentile (pct90) metrics compared to the baseline.



Service Level Agreement (SLA) Compliance & A/B Comparison

Goal: 0 Regression Response times (90th percentile) on the custom branch (jdbc-ping) must not degrade compared to the JDBC_PING2 baseline.

1. Core Authentication & Role Management Lifecycle

Transaction

SLA Status

TC_PARENT_LOGIN

✅ Met

TC_Create role

✅ Met

TC_Assign role to user

✅ Met

TC_Delete role

✅ Met

2. Failover Reliability

Goal: Minimal disruption during dynamic scaling and failover. Expectation is 0 dropped connections, or only momentary, acceptable spikes in 5xx errors while the cluster recovers.

Test Scenario

Defined SLA Target

Actual Observation

SLA Status

Notes

Scale Up (Add 2 nodes)

0 dropped connections / 0% error rate

[e.g., 0% errors]

✅ Met

Cluster successfully rebalanced without dropping active sessions. See screenshot

Scale Down (Remove 2 nodes)

0 dropped connections / 0% error rate

[e.g., 0% errors]

✅ Met

Existing sessions were successfully handed over. See screenshot

Failover (Force kill 2 node, 1 by 1)

0 dropped connections / 0% error rate

[e.g., 0% errors]

✅ Met

Cluster successfully rebalanced. See screenshot

Test Runs

Test run

Folio-keycloak module version

Test duration

Notes

Test run

Folio-keycloak module version

Test duration

Notes

Test 1

folio-keycloak:26.5.1

15 minutes

Baseline test

Test 2

folio-keycloak:26.5.7.269

15 minutes

A/B comparison test. Test 1 vs Test 2

Test 3

folio-keycloak:26.5.7.269

15 minutes

Failover Testing. After 7 minutes of the test, add 2 f-k containers. F-K containers at the beginning of the test - 3