10

I remember having been advised that it was helpful to configure both Size and MemSize when setting up the Tridion broker cache. The idea was that if you only configured one, then the other would have its default setting, and that the smaller of the two would "win".

Today I discussed this with someone who had been advised only to configure one of these values, so I went to check the documentation (2011) and it says the following:

To configure the overall cache, use either Size or MemSize

It may be that this was an issue in older versions of Tridion, and that in current versions it only heeds one limit if you only configure one.

Do I need to configure both settings, or should I use only one?

2
  • 1
    Older versions did not use MemSize, only Size, which was very confusing to implementers - exactly how much memory is needed for 400 objects? The other way around is also a valid question - how many objects fit in 200MB? So we offer both options, and you choose how to deal with it - depending on which question is more important to you
    – Nuno Linhares
    Jun 11, 2013 at 15:08
  • Yes - but is it a myth that if I only specify one, the other's default value will take effect? Jun 11, 2013 at 18:31

1 Answer 1

7
  • If both parameters are set, then both settings are taken into account.
  • If one of both is set, then only that one parameter is taken into account.
  • If none are set, the cache defaults to an object size of 128.

Of course, you can't really compare these two parameters in the sense that they correlate in terms of configurability. You can have 10000 objects in cache of 10KB each or 10 objects of 100MB each.

I actually almost never worry about the number of objects in cache. It can theoretically hold Integer.MAX_VALUE (231^1 = 2147483647) objects in the ConcurrentLinkedQueue class, which is the placeholder for cached elements. This is only an issue if you have a lot of threads banging against the cache all the time, because having a large concurrent cache may degrade performance in case of having a lot of threads running.

Memory is of course a different issue. A maximum memory size should always be set, in order not to let the JVM or even the server run out of it. Again, this is also only the case when you have a lot of big Tridion items published and cached, but even so - keeping a good eye on how much memory the cache actually uses is always something to monitor from time to time.

2
  • Often the worry is not that your cache will get too large, but that it will be too small and will therefore churn. That said - a good answer. Thanks. Jun 12, 2013 at 5:10
  • True enough. 128 is way too small these days. :)
    – Raimond
    Jun 12, 2013 at 6:10

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.