• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 6.15.3, 7.4.8, 7.9.3
    • Content - History
    • None

      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.

       

      Please be aware that disabling the recently-viewed-plugin will cause also the plugins dependent on it to be disabled. This may not be acceptable if these plugins are required. Below an example of the effect of disabling the plugin on v8.5:

      To disable plugins '[com.atlassian.confluence.plugins.recently-viewed-plugin]', we need to first disable all dependent enabled plugins: 
      [com.atlassian.confluence.plugins.confluence-nav-links(MANDATORY), 
      com.atlassian.confluence.plugins.confluence-onboarding(MANDATORY), 
      com.atlassian.mywork.mywork-confluence-provider-plugin(MANDATORY), 
      com.atlassian.business.insights.core-plugin(OPTIONAL), 
      com.atlassian.confluence.plugins.confluence-graphql-providers(MANDATORY),
      com.atlassian.confluence.plugins.confluence-dashboard(MANDATORY),
      com.atlassian.confluence.plugins.confluence-business-blueprints(MANDATORY),
      com.atlassian.confluence.plugins.atlassian-playbook-blueprints(MANDATORY), 
      com.atlassian.plugins.confluence-project-creation(MANDATORY), 
      com.atlassian.confluence.plugins.confluence-software-project(MANDATORY),
      com.atlassian.confluence.plugins.confluence-questions(OPTIONAL), 
      com.atlassian.confluence.plugins.confluence-retention-rules(OPTIONAL),             com.atlassian.confluence.plugins.confluence-software-blueprints(MANDATORY),
      com.atlassian.confluence.plugins.confluence-space-blueprints(MANDATORY), com.atlassian.confluence.plugins.confluence-knowledge-base(MANDATORY),
      com.atlassian.confluence.plugins.confluence-jira-content(MANDATORY), com.atlassian.confluence.plugins.confluence-auditing-coverage(OPTIONAL),
      com.atlassian.confluence.plugins.confluence-roadmap-plugin(MANDATORY),
      com.atlassian.confluence.plugins.confluence-webhooks(OPTIONAL), 
      confluence.extra.jira(MANDATORY), 
      com.atlassian.business.insights.confluence-plugin(OPTIONAL), 
      com.atlassian.confluence.plugins.confluence-mobile-plugin(MANDATORY),
      com.addonengine.analytics(OPTIONAL), 
      com.atlassian.confluence.plugins.confluence-inline-tasks(MANDATORY), 
      com.atlassian.confluence.plugin.copyspace(MANDATORY), 
      com.atlassian.confluence.plugins.confluence-create-content-plugin(MANDATORY), 
      com.atlassian.confluence.plugins.confluence-space-ia(MANDATORY)] 

            [CONFSERVER-58601] "Recently Worked on" page loads slowly

            An observation.

             

            I own a lot of Confluence documents, and the slow load is mainly a problem for me.

            At some point it vanished, and today I disabled "Collaborative Editing" on out instance, and it was back instantly. I am pretty sure the vanish was when we started using "Collaborative Editing"... thinking back

            So, there is some connection it seems - between the 2 parts.

            Normann P. Nielsen (Netic) added a comment - An observation.   I own a lot of Confluence documents, and the slow load is mainly a problem for me. At some point it vanished, and today I disabled "Collaborative Editing" on out instance, and it was back instantly. I am pretty sure the vanish was when we started using "Collaborative Editing"... thinking back So, there is some connection it seems - between the 2 parts.

            We have this problem on 7.19.4, using SQL Server v14, db driver version 7.4.1.0.

            Espen Sandall added a comment - We have this problem on 7.19.4, using SQL Server v14, db driver version 7.4.1.0.

            Gary Gary added a comment -

            In case this helps anyone... I struggled with this problem until I came across this report:
              https://jira.atlassian.com/browse/CONFSERVER-54984?error=login_required&error_description=Login+required&state=1990c41b-9adb-46e1-b48c-cd4d1ac85125

            Short version: MySQL 5.7 introduced an optimizer switch called "derived_merge" that has a negative effect on the performance of the "Recently" queries in Confluence.

            Adding this to my.cnf had a drastically positive effect in my environment:

              optimizer_switch = derived_merge=off

            Good luck!

             

            Gary Gary added a comment - In case this helps anyone... I struggled with this problem until I came across this report:   https://jira.atlassian.com/browse/CONFSERVER-54984?error=login_required&error_description=Login+required&state=1990c41b-9adb-46e1-b48c-cd4d1ac85125 Short version: MySQL 5.7 introduced an optimizer switch called "derived_merge" that has a negative effect on the performance of the "Recently" queries in Confluence. Adding this to my.cnf had a drastically positive effect in my environment:   optimizer_switch = derived_merge=off Good luck!  

            This is still an issue in 7.11.1. Disabling the recently-viewed-plugin is not an option to be honest.

            Application Support added a comment - This is still an issue in 7.11.1. Disabling the recently-viewed-plugin  is not an option to be honest.

            I am facing this issue on 7.4.0. 

             

            How to disable the recently-viewed-plugin? I did not find that option through the manage app. 

            Saurabh Malik added a comment - I am facing this issue on 7.4.0.    How to disable the  recently-viewed-plugin?  I did not find that option through the manage app. 

            This is still an issue in version 7.9.1.

            Michael Kornatzki added a comment - This is still an issue in version 7.9.1.

            This is still an issue in version 7.4.3.

            Craig Brand added a comment - This is still an issue in version 7.4.3.

              Unassigned Unassigned
              sshaw@atlassian.com Steve Shaw
              Affected customers:
              27 This affects my team
              Watchers:
              32 Start watching this issue

                Created:
                Updated: