8000 Remove unused providers when configuring the server · Issue #9832 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Remove unused providers when configuring the server #9832

Closed as not planned
Closed as not planned

Description

@DGuhr

Description

In order to improve startup, we should avoid loading unnecessary providers at startup (and unnecessary init). This should also help to achieve a lower memory fingerprint because only the expected providers are supposed to be loaded.

Currently, we already do that by checking whether or not a provider is disabled so that it is not added to the list of installed providers hence not loaded/inited at startup.

However, we should check if we can also keep only the default provider for certain Spi, for instance, have a single provider when loading providers of X509ClientCertificateLookupSpi. The same goes for any other Spi whose providers do not change at runtime and are supposed to have a single one installed. For instance, UserProfileSpi or ScriptingSpi.

Another example is the implementation of the map storages which should not be loaded at all in case JPA is being used.

From: https://issues.redhat.com/browse/KEYCLOAK-19304

Discussion

No response

Motivation

No response

Details

No response

Activity

  1. added
    kind/enhancementCategorizes a PR related to an enhancement
    area/dist/quarkusQuarkus distribution — packaging, container images, server config (kc.sh)
    on Jan 27, 2022
  2. added this to the milestone on Feb 4, 2022
  3. modified the milestones: , 17.1.0 on Mar 8, 2022
  4. modified the milestones: 18.0.0, 19.0.0 on Mar 30, 2022
  5. removed this from the 19.0.0 milestone on Jun 7, 2022
  6. shawkins commented on Aug 10, 2025

    @shawkins
    Contributor

    This seems like we'd need to mark relevant spi's as having singleton providers. However the effect of this would likely need to be opt-in.

    If not, there is always a possibility that custom logic may use one of the other getProvider methods to obtain one of the other enabled providers.

    Since there isn't a significant init cost nor memory footprint to the provider factories mentioned in request, most of the startup cost (loading the spi / providers, determining the defaults) has been moved to build-time, and there hasn't been movement on the issue in 3 years, resolving as not planned.

  7. DGuhr commented on Aug 10, 2025

    @DGuhr
    ContributorAuthor

    Yeh, it was just one I copied with a batch of others. when moved from jira at the time the quarkus foundation wasn't really there as it is now. Greetings to everyone.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dist/quarkusQuarkus distribution — packaging, container images, server config (kc.sh)kind/enhancementCategorizes a PR related to an enhancementteam/cloud-native

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0