Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-8555

Large number of realms causing slow startup due to user storage bootstrap

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.6.0.Final
    • Component/s: None
    • Labels:
    • Estimated Difficulty:
      Medium
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Call to UserStorageSyncManager.bootstrapPeriodic() is causing all realms to be queried.

          public void bootstrapPeriodic(final KeycloakSessionFactory sessionFactory, final TimerProvider timer) {
              KeycloakModelUtils.runJobInTransaction(sessionFactory, new KeycloakSessionTask() {
      
                  @Override
                  public void run(KeycloakSession session) {
                      List<RealmModel> realms = session.realms().getRealms();
                      for (final RealmModel realm : realms) {
                          List<UserStorageProviderModel> providers = realm.getUserStorageProviders();
                          for (final UserStorageProviderModel provider : providers) {
      

      Querying only realms with user storage provider will help improve performance.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            gideonray_jira Gideon Caranzo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: