[Logo] Mentawai Recipes
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register / 
[Login] Login 
Setting up a cache cluster  XML
Forum Index » Official Recipes
Author Message
saoj



Joined: 10/01/2008 08:20:15
Messages: 39
Offline

Mentawai uses JGroups (the best Java cluster solution?) to implement a distributed cache. This can be useful when you have many web servers in load balance and you want to accomplish seamless fail-over.

That's it! Just make sure the objects you place in the cache are serializable and all instances of your cache running in different machines will share the same data.

The default cache implementation is LRU (Least Resource Usage), so the least accessed entry will be removed when the cache gets full. You can also uso a FIFOCache (first in, first out, in other words, the oldest entry will be removed) like that:

If you are bringing a new web server into the load balance pool, keep in mind that it will first have to get all the entries from the cluster before it can start operating. This can take some time if the cache is too big.

Another option is to use the SynchronizedCache which just synchronizes new entries with the other nodes and does not have the startup overhead.

 
Forum Index » Official Recipes
Go to:   
Powered by JForum 2.1.8 © JForum Team