Monitor HST Enterprise Caching
Introduction
Goal
Monitor enterprise caching log messages and performance statistics.
Background
Enterprise Caching makes the community edition's page caching much more powerful and efficient, and makes a delivery tier cluster work more efficiently by reusing cached pages between cluster nodes. In addition, it allows for domain-specific optimization through cluster-wide caching.
For more information, see Understand HST Enterprise Caching and Enable and Configure HST Enterprise Caching.
This page explains how to monitor Enterprise Caching through logging and JMX.
Logging
To monitor the enterprise cache logging in a development environment, add to your log4j-dev.xml the following <logger/> elements:
<logger name="org.hippoecm.hst.cache" additivity="false"> <level value="debug"/> <appender-ref ref="messages"/> </logger> <logger name="com.onehippo.cms.spring.cache" additivity="false"> <level value="debug"/> <appender-ref ref="messages"/> </logger>
To monitor the logging in a production environment, you can add to your log4j-dist.xml the following <logger/> elements:
<logger name="org.hippoecm.hst.cache"> <level value="debug"/> </logger <logger name="com.onehippo.cms.spring.cache"> <level value="debug"/> </logger>
JMX
In addition to logging, we expose cache performance and statistics via JMX. In case the webapp is deployed as site (if deployed in a different context, say intranet, the names below will have intranet_ instead of site_) , the following MBeans related to community caching and enterprise caching are exposed over JMX
org.onehippo.hst:type=Caching,name=#/site_PageCache org.onehippo.hst:type=Caching,name=#/site_BinariesCache org.onehippo.hst:type=Caching,name=#/site_WebFilesCache com.onehippo.cms.spring.cache:type=CacheProfile,name=/site_clusterCache com.onehippo.cms.spring.cache:type=CacheProfile,name=/site_secondLevelCache com.onehippo.cms.spring.cache:type=CacheStats,name=/site_clusterCache com.onehippo.cms.spring.cache:type=CacheStats,name=/site_secondLevelCache com.onehippo.cms.spring.cache:type=CacheStats,name=/site_stalePageCache
The first three org.onehippo.hst beans expose general cache statistics for the PageCache, BinariesCache and WebFilesCache. If the Second Level Page Cache and/or Stale Page Cache is enabled, in org.onehippo.hst:type=Caching,name=#/site_PageCache you'll get the stats about the Second Level Page Cache and Stale Page Cache next to the community First Level Page Cache.
The com.onehippo.cms.spring.cache beans with type CacheProfile expose information about how long getting and putting entries in the cluster-wide Redis cache takes. The com.onehippo.cms.spring.cache beans with type CacheStats expose statistics of the three enterprise caches.