0

In my application I use ehcache with several caches that are backed by a terracotta server.

I noticed that there is a correlation between the size of the data that is saved in the server and the time it takes to create a cache manager instance in the client (the bigger the size the longer it takes).

I couldn't find any info about what actually happens when the cache manager is created. To my understanding, the data would only be pulled when it is actually requested and not when creating the manager, so what is the overhead?

Any thoughts or references to relevent reading would be much appreciated.

inbald
  • 115
  • 8

2 Answers2

0

First of all, CacheManager is not related to any data pushing or pulling, it create the caches which contains the elements as name value pairs and holds the data for put/get and other operations. Actually CacheManager do creation, access and removal of Caches.

ashish
  • 1
  • so the cache manager creation already creates the cache with some key value pairs in the client's memory? – inbald Jan 27 '14 at 20:54
  • actually no.. CacheManager only creates the Caches and initally cache will be empty by default. – ashish Mar 20 '14 at 09:50
0

In-fact when you create a CacheManager that has caches that participates in the terracotta cluster you might see a difference in the time it loads up. The cache manager will establish a connection to the server specified in the config. If there is any pre cache loaders like classes extending BootstrapCacheLoader will affect the load time too. The cache consistency attribute in caches that participate in the cluster has also impact on the load time. Terracotta server by design will push the most hit data to clients in order to reduce cache misses on local and also if the cache is identified for pinning.

Vishnu
  • 1,011
  • 14
  • 31
  • Vishnu thanks for answering! " Terracotta server by design will push the most hit data to clients" - do you have a reference that it happens when creating a cachemanager? Because it will definitely explain what I'm seeing – inbald Oct 27 '14 at 10:52
  • @inbald, please see this: http://terracotta.org/documentation/3.7.4/enterprise-ehcache/get-started. – Vishnu Oct 27 '14 at 12:43