Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-123387

Slow update times for Journal Article with hundreds of versions

    Details

    • Branch Version/s:
      7.3.x
    • Backported to Branch:
      Committed

      Description

      When updating a very large Journal Article with many versions, update times take longer.

      This is due to how we are retrieving the display article from JournalArticleLocalServiceImpl.fetchDisplayArticle(). In this method, we retrieve all versions from the article's resource, then determine the latest visible version.  However, when article version numbers reach high numbers, this retrieval begins to scale with the large volume of data being stored to memory, causing slow performance.

      The solution is now to introduce a configuration which allows for a cap to be placed on how many versions an article can have.  Any article version over this cap will be expired, starting with the lowest version number.

      Steps to reproduce:

      1. Copy com.liferay.journal.configuration.JournalServiceConfiguration.configinto the osgi/configs folder.  This configuration helps isolate this specific method's slow performance
      2. Set indexer.enabled[com.liferay.journal.model.JournalArticle]=false in your portal-ext.properties file
      3. Copy/paste the AddHighVersionedArticle.groovy script in server admin.  Modify values if needed, otherwise script will take a few minutes with default values.
      4. Execute the script

      Expected results: As version numbers increase, the time it takes to update an article shouldn't increase by much.

      Actual results: Update times increase drastically every few-hundred versions.

      Once the solution has been committed, the configuration "maxVersionCount" under com.liferay.journal.configuration.JournalServiceConfiguration can be set to an integer value, capping how many approved versions one article can have at a time.  Once capped, performance can be improved since less articles will be fetched and stored into memory at once.

      Reproduced on master: 8c6388b2ddd7a5cb16c9492347d7204b001438dd

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              team-echo Product Team Echo
              Reporter:
              christopher.kian Christopher Kian
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package