[infinispan-dev] Very confusing L1 cache configuration defaults
Michal Linhard
mlinhard at redhat.com
Wed Mar 21 10:21:41 EDT 2012
Hi,
when I was trying to figure out what is the L1 default configuration
The JDG default: DISABLED
when there is no l1-lifespan attribute in the element <distributed-cache
/>, L1 is disabled.
The Infinispan default: DISABLED
when there is no <l1/> element under <clustering/> element, or the <l1/>
element is empty, L1 is disabled.
However the hardwired default in the code is different:
https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/configuration/cache/L1ConfigurationBuilder.java#L36
the enabled field is set to true.
this also means that L1ConfigurationBuilder prints a debug message: " L1
is enabled and L1OnRehash was not defined, enabling it" even though L1
won't be enabled in the end.
The L1 is disabled because of the "activated" attribute.
All I need to change is one attribute of L1Configuration (even unrelated
to enablement) to "activate" it and it becomes enabled.
I don't know what is the purpose of the "activated" attribute, it seems
to be there for LegacyConfigurationAdaptor's purposes.
But when we get rid of it we might make L1 by default enabled (by mistake)
What's the desired default ?
IMO L1 should be disabled by default, because without proper eviction
settings, user can't very much control what's in each node's memory. And
in general the performance tests don't show it performs better.
Shouldn't we sync these ?
Either set enabled = false in L1ConfigurationBuilder or allow enablement
by default.
m.
--
Michal Linhard
Quality Assurance Engineer
JBoss Datagrid
Red Hat Czech s.r.o.
Purkynova 99 612 45 Brno, Czech Republic
phone: +420 532 294 320 ext. 62320
mobile: +420 728 626 363
More information about the infinispan-dev
mailing list