-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure Keycloak worker thread pool to be aligned with JGroup thread pool size #452
Configure Keycloak worker thread pool to be aligned with JGroup thread pool size #452
Conversation
@@ -0,0 +1,2 @@ | |||
Due to the bug https://issues.redhat.com/browse/ISPN-14780[ISPN-14780] there is currently no known way to configure the size different from the default JGroups 100 max threads, so assuming a Keycloak cluster with 4 Pods, each Pod shouldn't have more than 25 worker threads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not entirely true since you can still configure the thread pool in the extended stack. As an example
<jgroups>
<stack name="kubernetes-with-fdsock" extends="kubernetes">
<TCP thread_pool.max_threads="${env.JGROUPS_MAX_THREADS:200}" />
<!-- When using an embedded stack, replacement is done by Infinispan which requires environment variables to be
prefixed with ".env", while JGroups falls back to environment variables without the prefix.
The Keycloak Operator passes this information in an enviornment variable `jgroups.dns.query`.
See https://github.com/keycloak/keycloak/issues/21830 for a discussion.
-->
<dns.DNS_PING dns_query="${env.jgroups.dns.query}" />
<!-- Workaround for problems with FD_SOCK2, which might fail when the other nodes are not ready yet.
See https://github.com/keycloak/keycloak/issues/21092 -->
<FD_SOCK stack.combine="REPLACE" stack.position="FD_SOCK2"/>
</stack>
</jgroups>
ps. It looks for JGROUPS_MAX_THREADS
and if not set, it uses 200
threads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pruivo - I tried this. I debugged that the value was correctly picked up in StringPropertyReplacer
, but it never made it to the TCP
instance, where the thread pool was still set up to be 100 threads only.
So I guess I'll wait until ISPN-14780 fixed in an upcoming release.
@ahus1 do you think we need a run based off of the latest changes, if not I think the changes look good from the results we had from yday. |
@kami619 - I think we're good to merge this one. We should just let everyone know that we now restrict the number of Keycloak worker threads. We might lift that later with the next Infinispan upgrade to 200. |
This prepares the setup for the next upcoming load test where we align the Keycloak workers.
@kami619 - please review the docs and test in a single cluster with 100_000 sessions, 200 ups sustained load 100 pod kills (like the previous run where we saw the spikes).
Thanks!