Skip to content
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

Config update is very slow when there are 1000s of clients #1104

Open
erwin1 opened this issue Jul 17, 2024 · 3 comments
Open

Config update is very slow when there are 1000s of clients #1104

erwin1 opened this issue Jul 17, 2024 · 3 comments
Assignees

Comments

@erwin1
Copy link

erwin1 commented Jul 17, 2024

Problem Statement

Use-case:

  • keycloak-config-cli is used to update general realm configuration, custom authentication flows, ...
  • but it's not used to manage clients

Running keycloak-config-cli against a Keycloak instance with 1000s of clients is very slow (5+ minutes) because a partialExport including clients is run at the start.

https://github.com/adorsys/keycloak-config-cli/blob/main/src/main/java/de/adorsys/keycloak/config/service/ScopeMappingImportService.java#L68

Proposed Solution

Not sure if this would break other things, but for this use-case it would make sense to be able to exclude clients so they don't need to get exported.

Or maybe there are other work-arounds that could be used here?

Environment

  • Keycloak Version: 24.0.1
  • keycloak-config-cli Version: 5.11.1
  • Java Version: 17

Additional information

No response

Acceptance Criteria

No response

@erwin1 erwin1 changed the title Config update is very slow when there are a 1000s of clients Config update is very slow when there are 1000s of clients Jul 17, 2024
@AssahBismarkabah AssahBismarkabah self-assigned this Nov 8, 2024
@AssahBismarkabah
Copy link
Collaborator

AssahBismarkabah commented Nov 8, 2024

Hi @erwin1,

I've observed the same latency issue in updating the config across multiple clients—it’s indeed slow. While excluding certain clients is an option, it risks potential issues like incomplete or incorrect scope mappings, improperly set default client scopes, and missing protocol mappers for specific clients.

I explored a selective export approach, but it’s not feasible at scale. Manually specifying thousands of client IDs in the config is both tedious and unscalable, especially in large environments.

It seems we’ll need to explore more efficient methods to handle this issue effectively probably Allowing users to specify patterns for excluding or including clients, rather than listing individual client IDs..

@erwin1
Copy link
Author

erwin1 commented Nov 8, 2024

Quick update: the work-around in our case was simply to make sure nothing client related existed in the new config file(s). In that case keycloak-config-cli automatically excludes the full client export, which is nice.

I think the real solution is to improve the client export at the Keycloak side.

@AssahBismarkabah
Copy link
Collaborator

Quick update: the work-around in our case was simply to make sure nothing client related existed in the new config file(s). In that case keycloak-config-cli automatically excludes the full client export, which is nice.

I think the real solution is to improve the client export at the Keycloak side.

It seems appropriate to close this issue while we await enhancements from Keycloak, @erwin1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants