Created

Jul 09, 2012

Determine the right CRX bundle cache size for your application

Posted by Ankush Kumar

CRX Bundle Cache caches bundles, consisting of a node with all its properties. It is used by all bundle based Persistence Managers. The default size of this cache is set to 8 MB which is a part of allocated JVM heap. If an item is not found in the cache, it is read from the persistence layer.

However, default bundle cache size may not be optimized for performance in some scenarios. Hence, few tests should always be done to find out bundle cache size which suits your application. This can be analysed from miss to access ratio of the bundle cache which is captured in the error.log file as follows

org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager

cachename=crx.defaultBundleCache[ConcurrentCache@4b48638], elements=1987, usedmemorykb=4141, maxmemorykb=8192, access=27940, miss=19870

The above example shows an entry that indicates that cache was hit 27940 times. Out of this, for 19870 times, items were not found (missed) in cache and had to be fetched from the persistence layer. This is an example of high miss to access ratio of 0.71. Normally, lower the miss to access ratio, better is the performance. Hence, in such cases where ratio is high, one should increase cache size from 8 MB. However, one should NOT assign huge memory to bundle cache size either as this would impact the over all application performance. In internal tests, we found this bundle cache size value, somewhere near to 1/10th of JVM max heap size, gives best results. But this could differ for various scenarios (Read Heavy vs Write Heavy).


In CQ 5.5, apart from error.log, bundle cache can also be monitored from JMX MBeans. In order to do so, one can access following URL:

http://<server>:<port>/system/console/jmx

There are a number of MBeans of type TimeSeries which can provide information on cache usage, access, miss etc. This data can be utilized in determining usage trend of bundle cache.

Bundle cache size can be changed from repository.xml and workspace.xml using following tags:

<PersistenceManager class="com.day.crx.persistence.tar.TarPersistenceManager">

      <param name="bundleCacheSize" value="256"/>

</PersistenceManager>

COMMENTS

  • By Wang Zhong Kui - 9:02 AM on Jan 17, 2013   Reply
    I tried install a new bundle whose size is 463kb, after installing I download that bundle(jar file), but its size becomes 467kb and some functions have no effcet. Is this possible because this bundle cache? How to remove bundle cache? (CQ5.2)
  • By liquidy - 12:26 PM on Mar 30, 2013   Reply
    The above example shows an entry that indicates that cache was hit 27940 times. Out of this, for 19870 times, items were not found (missed) in cache and had to be fetched from the persistence layer. This is an example of high miss to access ratio of 0.71. Normally, lower the miss to access ratio, better is the performance. Hence, in such cases where ratio is high, one should increase cache size from 8 MB. However, one should NOT assign huge memory to bundle cache size either as this would impact the over all application performance. In internal tests, we found this bundle cache size value, somewhere near to 1/10th of JVM max heap size, gives best results. But this could differ for various scenarios (Read Heavy vs Write Heavy).

  • By jual propolis murah - 12:11 PM on Apr 05, 2013   Reply
    informative post, its so useful, keep it up
  • By manfaat madu - 12:11 PM on Apr 05, 2013   Reply
    wow, i dont know that, this is a great share, thank you
  • By belly bands for dogs - 12:14 PM on Apr 05, 2013   Reply
    nice share, it open my mind even more now, thanks
  • By wooden dog crates - 12:14 PM on Apr 05, 2013   Reply
    i dont know at first that it will be a useful information, but really, thank you for posting it
  • By bee propolis hd - 12:14 PM on Apr 05, 2013   Reply
    This information really helped me understand Things beyond my expertise. websites like this expanding knowledge everyone and I hope something like this will continue to grow
  • By diễn đàn seo - 5:00 AM on Apr 17, 2013   Reply
    its so useful, keep it up
  • By cộng đồng lập trình - 4:30 AM on Apr 18, 2013   Reply
    thanks
  • By Travel to Europe by car - 2:34 PM on Apr 20, 2013   Reply
    Thank you for such a fantastic blog. Where else could anyone get that kind of info written in such a perfect way? This is a nice blog. Good clean UI and nice informative blog. I Will Be Coming Back Soon, The list you provide for best doctors is really awesome!Thanks for taking the time to discuss this,
  • By hdi bee propolis - 9:38 AM on Apr 21, 2013   Reply
    awesome information man, thx
  • By manfaat madu asli - 10:25 AM on Apr 27, 2013   Reply
    what a great post, thx for the share
  • By wedding photographer nj - 5:30 PM on Apr 27, 2013   Reply
    Its great to see you taking the time to share this information
  • By Obat Kuat - 8:04 AM on May 16, 2013   Reply
    I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will locate that extremely useful...