On Oct 25, 2004, at 9:58 AM, Pierre van Rooden wrote:

Paul van Beukering wrote:
I mean backend caching. For example the result from clusterbuilder queries.
When calling getClusterNodes(query) I would want a query to be executed only
if the data in the database has changed. Otherwise, 99.99% times, it should
give me a cached result, sothat the query is not absorbing too much
processing time.

The multilevel cache does this for you. It caches the results of multilevel (cluster) queries. It invalidates the results when something changes in one of the objecttypes included in the result.
It can be quite effective if you have few changes in your cloud. It is less useful if you have many changes or use embargos.
You can change the size of the multilevel cache in the caches.xml in the MMBase config directory.


Is this possible, or do I have to use a mechanism that tells the clouds on
the multiple servers that data has changed and the clusternodes should be
retrieved again?

You can turn on multicast to signal servers when objects change. Every server has its own cache. Using multicast ensures that these caches are invalidated when chanegs are made. I don't think there is much documentation on multicast though.


And what about cloud.getNode() or nodeManager.getNodelist(), do they always
execute the query or can they give me a cached result?

Individual ndoes are acahed in the nodes cache. This cache can be quite large, so is pretty effective. It's size can also be configured in caches.xml.


-

Also it might be handy to look at the admin tool (the cache info) here you can see what caching hit/miss ratio's you are getting. After a while most of these number should
be in the 90% range. You could post a few of these results and we can tell you if they look normal or need some tuning.


Daniel.




Reply via email to