You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2013/07/02 15:00:21 UTC

[jira] [Commented] (OAK-863) Enable stats for various caches used in Oak by default

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

Thomas Mueller commented on OAK-863:
------------------------------------

Revision 1498912:

I refactored the caching mechanism a bit, so that in the future we could switch to one cache for the whole MongoMK.

I also added a LIRS cache implementation, so that we can find out why we have a low cache hit ratio. It is enabled by default right now (actually by mistake). To disable/enable it, set the system property "oak.mongoMK.lirsCache" to "true" or "false" (yeah I know, system properties are evil... it will be removed I promise).
                
> Enable stats for various caches used in Oak by default
> ------------------------------------------------------
>
>                 Key: OAK-863
>                 URL: https://issues.apache.org/jira/browse/OAK-863
>             Project: Jackrabbit Oak
>          Issue Type: Sub-task
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>            Priority: Minor
>             Fix For: 0.9
>
>         Attachments: cache-stats.png, OAK-863-1.patch, OAK-863-2.patch
>
>
> To get a better picture around the usage of cache it would be helpful to enable the [statistics|http://code.google.com/p/guava-libraries/wiki/CachesExplained#Statistics] for various caches used in Oak
> {code:java}
> nodeCache = CacheBuilder.newBuilder()
>                         .weigher(...)
>                         .maximumWeight(...)
>                         .recordStats()
>                         .build();
> {code}
> Once enabled it allows to get stats like below
> {noformat}
> CacheStats{hitCount=763322, missCount=51333, loadSuccessCount=0, loadExceptionCount=0, totalLoadTime=0, evictionCount=3496}
> {noformat}
> As stats collection adds a very minor overhead we can look into making this setting configurable. 
> Untill we expose the stats via JMX one can extract the value in Sling env via approach mentioned in [this gist|https://gist.github.com/chetanmeh/5748650]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira