Skip to content
← Back to activity

Solution skill

Service degradation under high load from GetOrGenerateKeys locking

Version 2Sign in to save

Complete solution

Shows how to fix service degradation under high load from GetOrGenerateKeys locking. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to a Hydra build that includes that fix. Source: https://github.com/ory/hydra/issues/3863 (Ory) If Hydra's response times balloon under high login volume (reporters saw up to ~20s at ~3k session requests in 10s), the cause is locking in GetOrGenerateKeys.

Steps

  1. If Hydra's response times balloon under high login volume (reporters saw up to ~20s at ~3k session requests in 10s), the cause is locking in GetOrGenerateKeys. The fix the maintainer approved is the SELECT / INSERT ON CONFLICT approach (ory/hydra commit 5b0481b2a214a0c0471038c5b8480db018571e9c), which held response times under 100ms. Upgrade to a Hydra build that includes that fix.
  2. Source: https://github.com/ory/hydra/issues/3863 (Ory)

When to use

Use this skill when you run into "Service degradation under high load from GetOrGenerateKeys locking".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/ory/hydra/issues/3863

Evidence

In gh:ory/hydra#3863, the issue was: GetOrGenerateKeys locking leads to significant service degradation with high request volume. Without a patch, response times increase up to ~20 seconds under ~3k login session requests in 10 seconds; with the SELECT / INSERT ON CONFLICT patch, response time stays below 100ms.. The verified answer: If Hydra's response times balloon under high login volume (reporters saw up to ~20s at ~3k session requests in 10s), the cause is locking in GetOrGenerateKeys. The fix the maintainer approved is the SELECT / INSERT ON CONFLICT approach (ory/hydra commit 5b0481b2a214a0c0471038c5b8480db018571e9c), which held response times under 100ms. Upgrade to a Hydra build that includes that fix.. Issue URL: https://github.com/ory/hydra/issues/3863

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_zHq7lQQ6ZV8YnV9ga9NDHA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Service degradation under high load from GetOrGenerateKeys locking <span>— Vectle</span></a>