jackrabbit-dev mailing list archives

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

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

Alex Parvulescu commented on JCR-3098:
--------------------------------------

you beat me to it :)
I was still testing out some cache changes.

my 2 cents:
 - Cache change: getHitCount / getMissCount . I'd drop hitCount as the cache already logs
accessCount (hitCount = accessCount - hitCount, you don't need to store this info on the cache)
                         putCount : it *should* follow a missCount. is is really necessary?

What I'm adding to the stats is the time is takes to recover from a cache miss, but that is
component based. Let's say a PersistenceManager impl has a cache miss, and it loads the info
from an external storage: you have access +1, miss +1 at the cache level (I don't need put
/ hit), also I'll compute the cache miss time locally on the PersistenceManager impl.

Also, an AbstractCache can have only one CacheAccessListener. I'm looking at the AbstractBundlePersistenceManager
which is now also a CacheAccessListener, that doesn't feel 100% right to me. What do you say
about using the Stats object as a dedicated PM cache listener, and there you could also log
this info.

As I said the code I'm working on is not committed yet, as I'm still testing, but we can definitely
unite our efforts. You can follow up with the changes on the dedicated JMX JR branch [0],
if that is something you would be interested in. And we'll merge back to trunk soon enough.


Overall I agree with the need to have more info on the caches, but this is a really sensitive
area, any change must be tested carefully.

ps. what is also missing from the cache info now is a cache miss reason: cold cache - the
entry was not there which would be no real reason to worry, or the entry has been evicted
previously which would probably indicate a low memory setting must be adjusted.

[0] http://svn.apache.org/repos/asf/jackrabbit/branches/JCR-2936/
                
> 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

        

Mime
View raw message