jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart van der Schans (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-3098) Add hit miss statistics and logging to caches
Date Fri, 07 Oct 2011 13:31:29 GMT

    [ https://issues.apache.org/jira/browse/JCR-3098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13122792#comment-13122792

Bart van der Schans commented on JCR-3098:

Hi Alex,

Thanks for the feedback.

The following statement is not correct for the current implementation: "hitCount = accessCount
- hitCount". The access count is used for resizing the caches (in resizeAll) and reset every
second or so. I didn't want to mess with the resizing allogrithm which need this reset. What
is true is that the "total accessCount" is the hitCount plus the missCount ;-)

The AbstractBundlePersistenceManager creates a new ConcurrentCache so this can have it's own
CacheListener. I'm not sure if we would need more than one listener for each cache. If there
is such a need we should either allow for that or indeed create a CacheStats object that can
contain information about all the caches. It could be more "elegant" to defer all stats to
a separate CacheStats object. On advantage of the current implementation is that you can "choose"
which cache stats you want to have logged by setting the appropriate classes to info logging.

I don't see an easy way without creating some overhead to get the cache miss reason. That
would require some "shadow" index which contains removed ids that have not yet been re-cached.
It would at least involve an extra check while fetching an item from the cache. And you have
to figure out what to do with deleted items so it doesn't definitively grows. 

I'm *very* interested in the JMX effort that is going on (we already use JMX to get all kind
of other info in our monitoring system). I consider the logging and collecting of the stats
as a first step before exposing the stats over JMX.  I'll have a look at the branch and try
to also make that next step ;-)

> Add hit miss statistics and logging to caches
> ---------------------------------------------
>                 Key: JCR-3098
>                 URL: https://issues.apache.org/jira/browse/JCR-3098
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Bart van der Schans
>             Fix For: 2.2.10, 2.3.1
>         Attachments: cache-stats.patch
> The current caches (ConcurrentCache) doesn't maintain hit and miss statistics. This makes
it very hard to know if you need to increase the caches in a deployment. This functionality
does exist in the 1.5 and 1.6 branches, but is missing from the 2.x branches. The patch adds
these statistics and adds logging on info level. The frequency of the logging is by default
configured to maximal once a minute but can be configured with the system property "org.apache.jackrabbit.cacheLogStatsInterval"
(in ms). 
> The log lines look like:
> 07.10.2011 09:00:39 INFO  [org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.logCacheStats():737]
name=defaultBundleCache[ConcurrentCache@54fb02fd] num=21074 mem=34504k max=65536k hits=93352
miss=21074 puts=21135
> 07.10.2011 09:00:40 INFO  [org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.logCacheStats():737]
name=versionBundleCache[ConcurrentCache@47b1de1a] num=10637 mem=250k max=8192k hits=36352
miss=10637 puts=10637
> This patch will also make possible to later on expose these statistics over JMX when
the initial JMX work has been settled.  

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message