-
1. Re: How memory is managed in distributed caching?
nadirx Feb 3, 2016 4:16 AM (in response to udit-mishra-5113a21a)1) Hi, you will want to read http://infinispan.org/docs/8.1.x/user_guide/user_guide.html#_distribution_mode as it contains detailed information about distribution, consistent hashing, owners, etc.
2) Without setting up eviction or expiration, you will get an OutOfMemoryError. Determining the memory occupation of entries in Java is tricky, but we do support eviction based on memory size which is quite accurate especially in client-server mode. If you don't want to lose entries when they are evicted from memory, set up a cache store and enable passivation.
3) Bear in mind that the DC contains no data. However, the node running the DC may also be running an actual server, and that will hold data. Eviction (number of entries or memory occupation) is per-node, so you need to multiply by the number of nodes and divide by the number of owners to get the actual number that is possible to store.
4) You can configure a distributed cache to be available or consistent in these cases. Read http://infinispan.org/docs/8.1.x/user_guide/user_guide.html#_partition_handling for details
-
2. Re: How memory is managed in distributed caching?
udit-mishra-5113a21a Feb 3, 2016 4:33 AM (in response to nadirx)Regarding the point 2, how can we specify eviction based on memory size?? as I can see in the docs, it is based on the number of entries i.e.
<eviction wakeUpInterval="500" maxEntries="2" strategy="LRU"/>
Regarding the point 3, if host.xml of the node which is running a domain controller contains a entry in , then only it will store data, right?
Additionally, is there any document which specifies all the available options of attributes of various subsystems of domain.xml?
-
3. Re: How memory is managed in distributed caching?
nadirx Feb 3, 2016 5:22 AM (in response to udit-mishra-5113a21a)Eviction size is configured as follows:
<eviction size="20000000" type="MEMORY" strategy="LRU"/>
which will configure 20MB.
Use the schema reference documentation for more details: https://docs.jboss.org/infinispan/8.1/configdocs/infinispan-config-8.1.html
As for the domain controller / host / server relationship, I think I need to clear things up:
- the domain controller (DC) is a very simple process: it does not contain any data. It reads the domain.xml to "assign" the configuration to the actual servers belonging to the various server groups. To do this it talks to the host controllers on other physical nodes. The domain controller can also act as a host controller for server running locally to it.
- the host controller is a process running on every host: it connects to the DC and provisions the servers on its own node. Similarly to the DC it does not actually contain any data. It is configured by host.xml.
- the server is the actual Infinispan node.
-
4. Re: How memory is managed in distributed caching?
udit-mishra-5113a21a Feb 3, 2016 8:47 AM (in response to nadirx)Alright, understood now. Thanks