Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-23743

General Configuration is slow to load when Confluence contains large number of Spaces

    XMLWordPrintable

Details

    Description

      For Confluence instance with large number of Spaces, General Configuration page loads very slow. Page load performance decreases drastically in Confluence with more than 2786 Spaces (in local testing, it was about 9 minutes load time).

      The viewgeneralconfig.action invokes the GeneralConfigurationAction.class, which makes a getSiteHomePages() call:

      com.atlassian.confluence.admin.actions.GeneralConfigurationAction
      
          public List<PairType> getSiteHomePages()
          {
              List<PairType> siteHomePages = new ArrayList<PairType>();
              siteHomePages.add(new PairType(getText("dashboard"), "dashboard"));
      
              boolean isGlobalAnonymousAccessEnabled = spacePermissionManager.hasPermission(SpacePermission.USE_CONFLUENCE_PERMISSION, null, null);
      
              List<Space> allSpaces = spaceManager.getAllSpaces(SpacesQuery.newQuery().withSpaceType(SpaceType.GLOBAL).build());
      
              for (Space space : allSpaces)
              {
                  if (isGlobalAnonymousAccessEnabled && spacePermissionManager.hasPermission(SpacePermission.VIEWSPACE_PERMISSION, space, null) ||
                      spacePermissionManager.groupHasPermission(SpacePermission.VIEWSPACE_PERMISSION, space, UserAccessor.GROUP_CONFLUENCE_USERS))
                  {
                      siteHomePages.add(new PairType(space.getKey(), space.getKey()));
                  }
              }
      
              return siteHomePages;
          }
      
      

      This is done to populate the set "Site Homepage" drop-down with all Spaces that is accessible by all users. The current approach does not scale well due to the following reasons (quoting @jclark@atlassian.com comment):

      Firstly, Confluence is un-necessarily loading every Space into memory when viewing the configuration, even though this information is only necessary when editing the configuration.

      Secondly, Confluence is performing extensive permission checks on every space when loading them, in order to ensure that an Administrator does not inadvertently set the Site homepage to a page that is not accessible to all users. This is a very expensive computation for what is, in effect, a minor usability improvement.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              halatas HuseinA
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: