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

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

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • Major
    • Resolution: Done
    • None
    • 4.6.0.Final
    • None
    • Medium
    • NEW
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: