[infinispan-dev] Global components per CacheManager

Mircea Markus mircea.markus at jboss.com
Mon Oct 25 07:22:29 EDT 2010


On 25 Oct 2010, at 11:58, Manik Surtani wrote:

> 
> On 25 Oct 2010, at 11:46, Mircea Markus wrote:
> 
>> 
>> On 25 Oct 2010, at 09:56, Galder Zamarreño wrote:
>> 
>>> 
>>> On Oct 24, 2010, at 10:41 PM, Vladimir Blagojevic wrote:
>>> 
>>>> User on a forum complained seeing eviction thread per created cache [1]. Although global configuration settings are shared amongst all caches created in CacheManager each created cache gets a fresh copy of these global elements?! Each created cache therefore indeed gets a new eviction executor service with one running thread. Does that mean that by default we also create one async transport executor per cache with 25 threads spinning? 
>>>> 
>>>> If so, we should tell users that running more than two dozen caches per CacheManager is going to impact the system significantly.
>>>> 
>>>> [1] http://community.jboss.org/thread/157913 
>>> 
>>> This is not down to the user. It's the 2LC case where there's a cache per each entity/collection type. So, if you have a lot of entities/collections in your case, you'll get this effect.
>>> 
>>> Expiration is set on per cache level, but maybe we need a more clever way for cache manager to manager expiration when two or more caches shared the same expiration settings. Or more simply, manage expiration at the cache manager level.
>> Expiration runs from eviction thread. It is possible to share the same eviction thread between multiple caches by writing a custom ScheduledExecutorFactory and specify it in the global evictionScheduledExecutor.  
> 
> Hmm, shouldn't this be the default?  :/
> 
> It is true that the global component is a singleton, in this case the global component is the DefaultExecutorFactory.
> 
> http://fisheye.jboss.org/browse/Infinispan/branches/4.2.x/core/src/main/java/org/infinispan/executors/DefaultExecutorFactory.java?r=1312#l19
> 
> But the factory creates a *new* executor each time it is asked for one.  
> 
> Perhaps we need a DefaultSharedExecutorFactory, which should be the *real* default?
+1 adding  DefaultSharedExecutorFactory to the code base so that users can use it
I think it should be the default one for async notifications where we 25 threads per cache. 
> 
> Cheers
> Manik 
> --
> Manik Surtani
> manik at jboss.org
> Lead, Infinispan
> Lead, JBoss Cache
> http://www.infinispan.org
> http://www.jbosscache.org
> 
> 
> 
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev




More information about the infinispan-dev mailing list