From cc7d6a9b797921520b95ab09b7b2c799b1904579 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Tue, 23 Jan 2024 13:56:55 +0100 Subject: [PATCH] Improve wording for Concepts for configuring thread pools in docs Closes #26402 Signed-off-by: Thomas Darimont Signed-off-by: Alexander Schwartz Co-authored-by: Alexander Schwartz --- docs/guides/high-availability/concepts-threads.adoc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/guides/high-availability/concepts-threads.adoc b/docs/guides/high-availability/concepts-threads.adoc index 2d5a405fa6..0b79e530ea 100644 --- a/docs/guides/high-availability/concepts-threads.adoc +++ b/docs/guides/high-availability/concepts-threads.adoc @@ -20,18 +20,19 @@ For a configuration where this is applied, visit <@links.ha id="deploy-keycloak- The Quarkus executor thread pool is configured in https://quarkus.io/guides/all-config#quarkus-core_quarkus.thread-pool.max-threads[`quarkus.thread-pool.max-threads`] and has a maximum size of at least 200 threads. Depending on the available CPU cores, it can grow even larger. -Threads are created as needed, and will end when no longer needed, so the system will scale up and down as needed. +Threads are created as needed, and will end when no longer needed, so the system will scale up and down automatically. -When running on Kubernetes, adjust the number of worker threads to avoid creating more load than what the CPU limit for the Pod to avoid throttling, which would lead to congestion. +When running on Kubernetes, adjust the number of worker threads to avoid creating more load than what the CPU limit allows for the Pod to avoid throttling, which would lead to congestion. When running on physical machines, adjust the number of worker threads to avoid creating more load than the node can handle to avoid congestion. Congestion would result in longer response times and an increased memory usage, and eventually an unstable system. Ideally, you should start with a low limit of threads and adjust it accordingly to the target throughput and response time. -When the load and the number of threads increases, the bottleneck can become be the database connections. +When the load and the number of threads increases, the database connections can also become a bottleneck. Once a request cannot acquire a database connection within 5 seconds, it will fail with a message in the log like `Unable to acquire JDBC Connection`. The caller will receive a response with a 5xx HTTP status code indicating a server side error. -If you increase the number of database connections and the number of threads too much, the system will be congested under a high load with requests queueing up and all callers getting a bad performance. +If you increase the number of database connections and the number of threads too much, the system will be congested under a high load with requests queueing up, which leads to a bad performance. +The number of database connections is configured via the https://www.keycloak.org/server/all-config#category-database[`Database`] settings `db-pool-initial-size`, `db-pool-min-size` and `db-pool-max-size` respectively. Low numbers ensure fast response times for all clients, even if there is an occasionally failing request when there is a load spike. === JGroups connection pool