PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-36049

Staging queries are made for every layout due to LayoutLister.getLayoutView()

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      4
    • Similar Issues:
      Show 5 results 

      Description

      The method: LayoutLister.getLayoutView()
      seems to be slowing the "manage pages" down because it has a recursive method called _createList(long parentLayoutId, int parentId, int depth) which iterates through each layout to get the child layouts of each set. For example, if you have a number such as 10,000 pages, then it will call _createList_createList() 10,000 times and you will have 10,000 queries in the database. Based on the testing, we believe this is what's causing the slowness.

        Issue Links

          Activity

          Hide
          Brian Wulbern added a comment -

          PASSED Manual Testing using the following steps:

          1. Set the Log Levels (Control Panel > Server Administration > Log Levels)
            • Update Category: com.liferay.portal.lar --> DEBUG
            • Add Category: com.liferay.portal.service.persistence.LayoutRevisionPersistenceImpl --> DEBUG
          2. Create a Site with 1000 pages (using a script in a browser console, or in firebug -
            AUI().Get.script('http://git.io/sGKk5w'); works, just follow the prompts--thanks to Marc Lundgren for that tool)
            • Wait a minute or two for the command to finish
          3. Navigate to Site Settings for the created Site > Staging
          4. Enable Local Live Staging
            • Flag Public Page versioning
          5. Click Save
          6. Observe the output in console

          Reproduced on:
          Tomcat 7 + MySQL 5. Portal 6.2.x GIT ID: 08b3a3090df012a50efc994c564239cc4a59c454.

          Fixed on:
          Tomcat 7 + MySQL 5. Portal EE 6.1.x GIT ID: a75a13983d07d99d066f6cf20ef853bd1766af95.
          Tomcat 7 + MySQL 5. Portal 6.2.x GIT ID: 1725e10b8a2f6d0bc75f01158456ffb9e10b47da.

          With the GIT ID the issue was reproduced on, the conversion to versioned Staging takes more than 120 seconds with 1000 pages. On the fixed versions for 6.1.x and 6.2.x, it takes 12 seconds and 24 seconds, respectively. This difference is more noticeable with increased numbers of pages.

          Show
          Brian Wulbern added a comment - PASSED Manual Testing using the following steps: Set the Log Levels (Control Panel > Server Administration > Log Levels) Update Category: com.liferay.portal.lar --> DEBUG Add Category: com.liferay.portal.service.persistence.LayoutRevisionPersistenceImpl --> DEBUG Create a Site with 1000 pages (using a script in a browser console, or in firebug - AUI().Get.script('http://git.io/sGKk5w'); works, just follow the prompts--thanks to Marc Lundgren for that tool) Wait a minute or two for the command to finish Navigate to Site Settings for the created Site > Staging Enable Local Live Staging Flag Public Page versioning Click Save Observe the output in console Reproduced on: Tomcat 7 + MySQL 5. Portal 6.2.x GIT ID: 08b3a3090df012a50efc994c564239cc4a59c454. Fixed on: Tomcat 7 + MySQL 5. Portal EE 6.1.x GIT ID: a75a13983d07d99d066f6cf20ef853bd1766af95. Tomcat 7 + MySQL 5. Portal 6.2.x GIT ID: 1725e10b8a2f6d0bc75f01158456ffb9e10b47da. With the GIT ID the issue was reproduced on, the conversion to versioned Staging takes more than 120 seconds with 1000 pages. On the fixed versions for 6.1.x and 6.2.x, it takes 12 seconds and 24 seconds, respectively. This difference is more noticeable with increased numbers of pages.

            People

            • Assignee:
              Brian Wulbern
              Reporter:
              Arthur Hsiao (Inactive)
              Recent user:
              Esther Sanz
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 45 weeks, 2 days ago

                Development

                  Structure Helper Panel