Hello,

I am seeing some strange behavior where checking permissions for
authorization runs quickly for a few days but then the time it takes to
check permissions dramatically slows down.  This appears to occur after a
few days of running the application.  I took a look at this post but I don't
think it is the same issue:
http://shiro-user.582556.n2.nabble.com/Invalidating-Authentication-Cache-slows-performance-td6329816.html#a6333063

We are configuring Shiro programmatically as follows:

 public static void initSecurityManager() {
                 
        //Set realms
        mSecurityManager = new DefaultSecurityManager();
        mSecurityManager.setAuthenticator(new MockAuthenticator());
        ArrayList <Realm> realms = new ArrayList<Realm>();
        realms.add(new PortalRealm());
        realms.add(new PortalBaselineRealm());
        mSecurityManager.setRealms(realms);
                        
        //Setup caching
        EhCacheManager shiroCacheManager = new EhCacheManager();
        CacheManager cacheManager = CacheManager.create();
        Ehcache cache = cacheManager.getEhcache(SHIRO_CACHE);
        shiroCacheManager.setCacheManager(cache.getCacheManager());
        mSecurityManager.setCacheManager(shiroCacheManager);  
                
       //Set session timeout
      
((DefaultSessionManager)mSecurityManager.getSessionManager()).setGlobalSessionTimeout(28800000);
        SecurityUtils.setSecurityManager(mSecurityManager);
         }

Our entry in the ehcache.xml is as follows:


    <cache name="shiroCache"
           maxElementsInMemory="10000"
           eternal="false"
           timeToIdleSeconds="3600"
           timeToLiveSeconds="3600"
           memoryStoreEvictionPolicy="LFU"
           >
</cache>

In addition to Shiro's caching, we have another self populating ehcache that
actually holds the permissions when they are retrieved from the database. 
However, I don't think this should be an issue.  Any help would be
appreciated.  Thanks. 
    



--
View this message in context: 
http://shiro-user.582556.n2.nabble.com/Performance-slows-dramatically-over-time-when-checking-permissions-for-authorization-tp7578867.html
Sent from the Shiro User mailing list archive at Nabble.com.

Reply via email to