3

It looks like the CD object cache in our implementation is only allowed to contain 128 items. The logging below suggests that as soon the broker tries to cache #129, an old item is removed before the new item is added.

This is confirmed by other things we see: if we start the app and request page 1, the page and all its dependencies (about 80 items in total) are cached. If we then request page 2, that is also cached but page 1 is no longer in the cache.

Questions:

  • Is it really the case that the number of items in the cache is by default limited to 128 items?

  • If so, how can we override this number?

The logging below is taken from our web application server.

16:42:41.832 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUModel: listSize = 129  memSize = 465310
16:42:41.832 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: maximum list size exceeded
16:42:41.832 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - Removing node with key 319:/system/assets/js/Lib/jquery.min.js
16:42:41.832 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: reduced list size to 128
16:42:41.832 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUModel: listSize = 129  memSize = 476518
16:42:41.833 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: maximum list size exceeded
16:42:41.833 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - Removing node with key 319:173730:true
16:42:41.833 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: reduced list size to 128
16:42:41.835 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUModel: listSize = 129  memSize = 476257
16:42:41.835 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: maximum list size exceeded
16:42:41.835 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - Removing node with key 319:/system/assets/js/default.min.js
16:42:41.836 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: reduced list size to 128
16:42:41.836 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUModel: listSize = 129  memSize = 476188
16:42:41.836 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: maximum list size exceeded
16:42:41.836 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - Removing node with key 319:174439:true
16:42:41.836 [WebContainer : 1] DEBUG com.tridion.cache.LRUPolicy - LRUPolicy.processPut: reduced list size to 128
16:42:41.837 [WebContainer : 1] DEBUG com.tridion.cache.CacheController - Adding a dependency from Object [319:172694] in Region [/com_tridion_linking_ComponentLinkInfo] to Object [false:false:319:-1:172694:-1:null:] in Region [/com.tridion.linking.ComponentLink]
1
  • I thought we set that in the Remote Sync? Something like: <RemoteSynchronization Host="127.0.0.1" Port="1099" Queuesize="128" ServiceMonitorInterval="10000"/>
    – Kunal
    Jun 16, 2016 at 19:27

2 Answers 2

2

Quirijn, documentation say that the size can be configured when defining the policy itself

http://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v1/GUID-D10BB04E-192D-432D-A00D-01D74182A260

Example:

<Policy Type="LRU" Class="com.tridion.cache.LRUPolicy">
   <Param Name="Size" Value="128" />
   <Param Name="MemSize" Value="32M" />
</Policy>
6
  • We tried that, but it seems it is ignored. The size is always 128.
    – Quirijn
    Jun 16, 2016 at 20:08
  • Perhaps both the Policy.Size and the RemoteSynchronization.Quesize need to be changed?
    – Kunal
    Jun 16, 2016 at 20:13
  • Set the Param.MemSize to 256mb and the RemoteSynchronization.Queuesize to a big number, then you should be good. (Ignore the Param.Size).
    – hoang
    Jun 16, 2016 at 20:36
  • It's either Param.Size or Param.MemSize. If you set Param.Size then give it a value equal to or lower than RemoteSynchronization.Queuesize. Else omit it and set Param.MemSize to default max 256mb and a decent value for RemoteSynchronization.Queuesize.
    – hoang
    Jun 16, 2016 at 20:50
  • 1
    You are absolutely right! Turned out I had a different problem: for some reason the LRUPolicy wasn't loaded. This is the class that consumes these XML parameters. If it cannot be loaded for whatever reason, the EmptyPolicy is used instead, which is hardcoded to a list size of 128.
    – Quirijn
    Jun 16, 2016 at 22:15
4

The default maximum is indeed 128 queue events. You can change this by specifying a different value for Queuesize attribute in the element RemoteSynchronization in the cd_storage_conf.xml file.

Be generous with the queue size. Especially in a multilingual implementation. This number can easily exceed 1000000 and beyond.

To figure out a good Queuesize number set an unrealistic high Queuesize value, then run in DEBUG mode for a while (e.g. a day or two), or better yet run a crawler to crawl the entire site, and then check the log. The listSize grows quick when there is high traffic on the website and when no publishing activities are going on (no cache invalidations). Check the latest listSize's. Add to it 10000. Then you have a decent Queuesize.

6
  • good timing ;-)
    – Kunal
    Jun 16, 2016 at 19:28
  • @Kunal Shetye i see what you're saying :)
    – hoang
    Jun 16, 2016 at 19:39
  • I thought the Queusize had to do with some queue of items waiting to be placed in the cache. Are you saying it is simply the number of items you can have in the cache?
    – Quirijn
    Jun 16, 2016 at 19:48
  • @Quirijn, exactly.
    – hoang
    Jun 16, 2016 at 19:50
  • I looked into it, Hoang, and I can now confirm that the QueueSize is for the communication with the cache channel service. It is the maximum number of items that are waiting to be sent off for invalidation. The <Param Name="Size" .../> deals with the number of items that can be held in the cache.
    – Quirijn
    Jun 16, 2016 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.