Keycloak auth manager causes long loading times for the webserver #56502
Unanswered
cboettcher
asked this question in
General
Replies: 2 comments
-
cc @vincbeck WDYT? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Some additional context from what I've already looked into and thought about: Here Is the function that is called for every singel-resource authentication request, and it creates a request to keycloak every time. The batch function does not seem to be used much. I tried something like this, which seemed to solve the loading time issue, but it kinda ignores the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After configuring the Keycloak auth manager (from the keycloak providers package) in our helm-based deployment, i realized that the loading times of the website were incredibly high.
I then did some digging through the logs, and found that the auth manager seems to send a new request to keycloak for every kind of permission that was needed, causing between 2 and 4 requests per second for a single user.
Since this seemed too much for me, i looked through the code of the auth manager and found that indeed, unless a batch_permission was checked, it would create a new request every time.
Is there a specific reason for this, instead of requesting and caching the whole set of permissions at once? The python-keycloak library offers functions for retrieving all permissions, so even short-lived caches would reduce the amount of requests to keycloak significantly.
I don't know if this is considered a bug, so i created this discussion thread. I'm also willing to create an issue instead, but wanted to get a second opinion first.
Beta Was this translation helpful? Give feedback.
All reactions