Uploaded image for project: 'Confluence Server and Data Center'
  1. Confluence Server and Data Center
  2. CONFSERVER-58601

"Recently Worked on" page loads slowly

    XMLWordPrintable

Details

    • Bug
    • Status: Gathering Impact (View Workflow)
    • Low
    • Resolution: Unresolved
    • 6.15.3, 7.9.3, 7.4.8
    • None
    • Content - History
    • None

    Description

      Issue Summary

      Slow page loading times can result when opening the "Recently Worked on" page.

      Environment

      • 6.15.3
      • MySQL 5.7

      Steps to Reproduce

      This problem occurs while opening the "Recently Worked on" page.

      Expected Results

      Page loads within a reasonable amount of time

      Actual Results

      The page loading is slow taking up to 14 seconds

      Symptoms

      Aside from the slowness observed in the UI, this problem has the following symptoms:

      • If a HAR file is captured while loading the page, the following URL call will take quite a bit of time to complete:
        <confluence-base-url>/rest/api/content/search?expand=container,metadata.currentuser.lastcontributed,metadata.currentuser.lastmodified
      • If SQL debugging is enabled, the following method call will take the longest to complete while processing the above URL:
        ContentEntityManager.getVersionsLastEditedByUser()
        
      • If thread dumps are taken while loading the page, most threads will reference calls to com.atlassian.confluence.core.DefaultContentEntityManager.getVersionsLastEditedByUser.
      • While the actual SQL queries execute quickly, most of the processing is taken up within the Hibernate layer.

      Analysis

      The following Java method was found to be inefficient as it is supposed to retrieve all pages (including drafts) that a specified user edited in the past, but only the latest versions of these documents:

      com.atlassian.confluence.internal.persistence.hibernate.AbstractContentEntityObjectHibernateDao#getVersionsLastEditedByUserNew
      

      However, it retrieves all versions of these pages and ends up discarding the majority of the returned records which is most likely causing the delay in rendering the results.

      Workaround

      A possible workaround would be to disable the recently-viewed-plugin altogether to prevent these queries from being executed. If this is acceptable, then it's the only way to reduce the load time until proper fix is implemented.  Please also see the work around listed in CONFSERVER-57457 as this appears to be related.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sshaw@atlassian.com Steve Shaw
              Votes:
              19 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

                Created:
                Updated: