[Building Sakai] UserDirectoryService memory readout and cache setting questions

Gross,Christopher ufchrisg at ufl.edu
Thu Aug 26 12:09:11 PDT 2010


Their set by bean definitions in the kernel component:

    <!-- Memory cache for user authentication. -->
    <bean id="org.sakaiproject.user.api.AuthenticationManager.cache"
        class="org.springframework.cache.ehcache.EhCacheFactoryBean">
        <property name="cacheManager">
            <ref
bean="org.sakaiproject.memory.api.MemoryService.cacheManager"/>
        </property>
        <property name="cacheName">
            <value>org.sakaiproject.user.api.AuthenticationManager</value>
        </property>
        <property name="maxElementsInMemory" value="10000" />
        <property name="diskPersistent" value="false" />
        <property name="eternal" value="false" />
        <property name="timeToLive" value="120" />
    </bean>

    <!-- Memory cache for user lookup. -->
    <bean id="org.sakaiproject.user.api.UserDirectoryService.cache"
         class="org.springframework.cache.ehcache.EhCacheFactoryBean">
         <property name="cacheManager">
            <ref
bean="org.sakaiproject.memory.api.MemoryService.cacheManager"/>
          </property>
          <property name="cacheName">
            <value>org.sakaiproject.user.api.UserDirectoryService</value>
          </property>
        <property name="maxElementsInMemory" value="100000" />
        <property name="diskPersistent" value="false" />
        <property name="eternal" value="false" />
        <property name="timeToLive" value="7200" />
        <property name="timeToIdle" value="7200" />
    </bean>

So you could set the config via:
diskPersisten at org.sakaiproject.user.api.UserDirectoryService.cache=true
for instance in sakaiproperties

Thanks for the response!

I actually tried this with the timeToLive property but the users are still being looked up every 5 minutes.  The cacheMinutes at org.sakaiproject.user.api.UserDirectoryService IS set to 5 minutes but changing that does nothing.  We have the config viewer tool installed so I can see that the cacheMinutes value has changed yet if I monitor the provider I see that pretty much exactly 5 minutes after a site info page is viewed if it is viewed again the provider is queried for the entire participant list.  If that page is viewed any time between the initial and 5+ minutes later no hits are made to the provider as it is getting the information from cache, as expected, however we cannot find where this 5 minutes is being set and have tried all types of properties and even went through every property file to ensure it was not being set somewhere downstream.

I also dug into the code for the BaseUserDirectoryService class in kernel-impl and found that the cacheMinutes at org.sakaiproject.user.api.UserDirectoryService property should indeed be the TTL for the cache items however changing it is having no affect.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100826/012f6575/attachment.html 


More information about the sakai-dev mailing list