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

Performance regression in generating page tree for custom space exports

XMLWordPrintable

      Problem summary

      The functionality which generates a page tree for customized space exports is taking much longer in 5.8, 5.9, and even more so in 5.10. This page tree can be observed at Space Tools > Content Tools > Export > Any Option > Custom Export, with the specific request URL being http://<confluence_url>/spaces/exportspacetree.action?key=SPACEKEY.

      With a large enough space, the request will time out after hitting a Confluence or proxy server timeout, and prevent users from customizing the space export. Smaller spaces do not run into this issue, but then again there is less need to pick-and-choose pages to export in a smaller space to begin with. Many customers use this feature to export a subset of a large space to PDF, and this performance regression blocks that functionality.

      Speed comparison

      Since this issue is about a performance regression since 5.7, we need to compare the load times in each major Confluence version for http://<confluence_url>/spaces/exportspacetree.action?key=SPACEKEY given the same set of data. The below are the times I captured using Profile Logging, and also links to XML backups to the datasets I used should someone desire to reproduce for themselves.

      Also included are screenshots taken using JProfiler showing a sampling of methods in 5.7, 5.8, and 5.10. This is sorted by average time.

      Each data set is identical in terms of pages. There is a single space ("FOO") containing 2023 randomly generated pages that are deeply nested. The credentials to login for is admin/admin:

      Version Time XML Backup Method Avg Times
      5.7.5 22909 ms conf575.zip
      5.8.13 36238ms conf5813.zip
      5.9.9 32865ms conf599.zip N/A
      5.10.3 42128ms conf5103.zip

      Full profile logging results for all versions are available here: profiling.txt

      Steps to reproduce

      1. Download a version of Confluence you'd like to test
      2. Create a space and generate at least 2000 pages within (or use a backup XML file above)
      3. Turn on Profile Logging
      4. Go to http://<confluence_url>/spaces/exportspacetree.action?key=SPACEKEY

      Workaround

      Perform the request to generate the page tree once and wait several minutes. Even if a request times out from the client side the first time, the query is still fully executed on the server (although you won't have any feedback on when it finishes). On subsequent requests, Confluence may use the now-cached query results, thus reducing the time to generate the page tree on a second attempt and allow the request to complete in the UI.

      Notes

      • There appears to be 2 performance regressions. One in between 5.7 and 5.8, and another between 5.9. and 5.10. Looking at the methods, it looks like the one between 5.7 and 5.8 may be due to changes in permission checking in regards to Edit and View page restrictions. This is possibly a result of CONF-17523
      • Implementing a solution such as CONF-33751 may help so that the entire space's page tree is not loaded at once

        1. conf575.zip
          1.38 MB
        2. conf5813.zip
          1.39 MB
        3. conf599.zip
          1.41 MB
        4. conf5103.zip
          1.48 MB
        5. conf5813_cpu_method_runnable.png
          conf5813_cpu_method_runnable.png
          277 kB
        6. conf5103_cpu_method_runnable.png
          conf5103_cpu_method_runnable.png
          251 kB
        7. conf575_cpu_method_runnable.png
          conf575_cpu_method_runnable.png
          250 kB
        8. profiling.txt
          7 kB
        9. xmlexport-20161012-154845-1.zip
          634 kB

              fxu Feng Xu (Inactive)
              rchang Robert Chang
              Votes:
              4 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: