Skip to content

Commit

Permalink
Use the http-max-queued-requests option for load shedding in HA docs
Browse files Browse the repository at this point in the history
Resolves keycloak#26223

Signed-off-by: Ryan Emerson <[email protected]>
  • Loading branch information
ryanemerson authored Jan 17, 2024
1 parent 0127e0e commit ba76682
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions docs/guides/high-availability/concepts-threads.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ By default, {project_name} will queue all incoming requests infinitely, even if
This will use additional memory in the Pod, can exhaust resources in the load balancers, and the requests will eventually time out on the client side without the client knowing if the request has been processed.
To limit the number of queued requests in {project_name}, set an additional Quarkus configuration option.

Configure `quarkus.thread-pool.queue-size` to specify a maximum queue length to allow for effective load shedding once this queue size is exceeded.
Configure `http-max-queued-requests` to specify a maximum queue length to allow for effective load shedding once this queue size is exceeded.
Assuming a {project_name} Pod processes around 200 requests per second, a queue of 1000 would lead to maximum waiting times of around 5 seconds.

// KC22.0.6 - this is still 500
When this setting is active, requests that exceed the number of queued requests will return with an HTTP 503 error.
{project_name} logs the error message in its log.

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/high-availability/deploy-keycloak-kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ kubectl wait --for=condition=RollingUpdate=False keycloaks.k8s.keycloak.org/keyc

To enable load shedding, limit the number of queued requests.

.Load shedding with Quarkus thread pool size
.Load shedding with max queued http requests
[source,yaml,indent=0]
----
env:
spec:
additionalOptions:
include::examples/generated/keycloak.yaml[tag=keycloak-queue-size]
----
<1> This change limits the number of queued {project_name} requests.
All exceeding requests are served with an HTTP 503.
See the <@links.ha id="concepts-threads" /> {section} about load shedding for details.

Expand Down

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/guides/high-availability/examples/generated/keycloak.yaml

Large diffs are not rendered by default.

0 comments on commit ba76682

Please sign in to comment.