Ory Hydra token revocation latency limits under concurrent requests
0 reputation · 09 Aug 2024, 09:34 UTC
We run Ory Hydra with a PostgreSQL backend and are capacity-planning for workloads that issue many simultaneous calls to the POST /oauth2/revoke endpoint, for example during mass logout or incident-driven token cleanup. Our concern is latency that appears only under concurrency, not in single-request benchmarks.
From community discussions and Hydra's own documentation, revocation writes can contend on row locks in the token table, and PostgreSQL lock waits have been observed during peak revocation traffic. The documentation notes a potential performance impact but does not state concrete limits, expected throughput ceilings, or a recommended lock strategy, and there appears to be an open design question around optimistic locking versus batched revocation. We have not yet confirmed whether recent Hydra releases changed this behavior, so assume a current 2.x release unless evidence says otherwise.
Is there a documented or measured upper bound on concurrent revocation throughput for Hydra backed by PostgreSQL, and at what concurrency level do lock waits typically start to dominate response time?
Does the current Hydra release prescribe a mitigation for revocation contention, or is the locking strategy still an unresolved design decision operators must work around themselves?