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 log4j2-dev.xml the following <Logger/> elements:
<Logger additivity="false" name="org.hippoecm.hst.cache" level="debug"> <AppenderRef ref="messages"/> </Logger> <Logger additivity="false" name="com.onehippo.cms.spring.cache" level="debug"> <AppenderRef ref="messages"/> </Logger>
To monitor the logging in a production environment, you can add to your log4j2-dist.xml the following <Logger/> elements:
<Logger additivity="false" name="org.hippoecm.hst.cache" level="debug"/> <Logger additivity="false" name="com.onehippo.cms.spring.cache" level="debug"/>
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=CacheStats,name=/site_stalePageCache # with Redis, brXM 14.x only 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
The first three org.onehippo.hst beans expose general cache statistics for the PageCache, BinariesCache and WebFilesCache.
If the Stale Page Cache is enabled, in org.onehippo.hst:type=Caching,name=#/site_PageCache you'll get the stats about the Stale Page Cache next to the community First Level Page Cache.
BrXM 14 only: If the Second Level Page Cache is enabled, in org.onehippo.hst:type=Caching,name=#/site_PageCache you'll get the stats about the Second Level Page Cache as well.
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.