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

CheckArticles scheduled job is clearing the portal cache when sharding is enabled

Details

    Description

      This job is clearing the portal cache each 15 minutes (this is the default value configured via property journal.article.check.interval=15), which has a lot of impact in the portal performance.

      Note: Only reproducible with a DB Sharding enabled

      Steps to check the issue

      1. Configure a db sharding environment folloking link Database Sharding
      2. Add next property to portal-ext.properties for doing easier the test: journal.article.check.interval=2
      3. Restart the server and create a new portal instance in the second shard from Control Panel > Instances
      4. Got to Control Panel > Server Admin. > Log levels > add category: com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl ALL
      5. Run jconsole in a terminal, if your server is running in localhost connect to the local process org.apache.catalina.startup.Bootstrap
      6. In the portal - Run the groovy script:

      for (def g: com.liferay.portal.service.GroupLocalServiceUtil.getGroups(-1, -1)) {
      out.println (com.liferay.portal.service.GroupLocalServiceUtil.getGroup(g.getGroupId()).getName())
      }
      

      7. In JConsole Go to the MBeans and navigate to net.sf.ehcache - CacheStatistics - liferay-multi-vm-clustered - com.liferay.portal.kernel.dao.orm.EntityCache.com.liferay.portal.model.impl.GroupImpl
      8. Get the Attribute - ObjectCount - Refresh, you will check the number of cached layouts, for example: 10
      9. Check the logs until you view a trace like this (it appears each 2 minutes and appears repeated by each shard):

      14:53:25,689 DEBUG [liferay/scheduler_dispatch-4][JournalArticleLocalServiceImpl:5801] Expiring 0 articles

      10. In JConsole, refresh the same attribute ObjectCount after the trace appears.

      Results The cache has been cleared and the number of objects is 0 or 1 (may be there is any object but the most of the objects in cache has been cleared).
      Expected Number of objects are the same.

      Attachments

        Issue Links

          Activity

            People

              melody.wu Melody Wu
              jose.jimenez Jose Jimenez
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5 years, 38 weeks, 5 days ago

                Packages

                  Version Package
                  6.2.X EE