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
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:
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):
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.