[Building Sakai] UserDirectoryService memory readout and cache setting questions

David Horwitz david.horwitz at uct.ac.za
Wed Aug 25 07:51:45 PDT 2010


Hi,

See bellow

On 08/25/2010 04:38 PM, Gross,Christopher wrote:
> Hello!
>
> When looking at the memory tool we have the following showing for the
> UserDirectoryService:
>
> org.sakaiproject.user.api.UserDirectoryService: count:15454
> hits:548289 misses:35331 hit%:93
> org.sakaiproject.user.api.UserDirectoryService.callCache: count:1349
> hits:1424509 misses:156192 hit%:90
>
Yes that means that the UDS cache is hit 3% more than the call cache.
The difference between the 2 is that the call cache caches the responses
of certain calls in the service (call x for user y was false) while the
cache caches eid->id mappings both ways (so there well be 2 entries for
each use).

Your values look pretty similar to ours:

org.sakaiproject.user.api.UserDirectoryService: count:27704 hits:2124411
misses:262952 hit%:88
org.sakaiproject.user.api.UserDirectoryService.callCache: count:2515
hits:46455720 misses:2995062 hit%:93




> I can gather for the most part what I *think* that means but I was
> hoping I could get someone who actually knows to tell me what each of
> those values are because some of it doesn't necessarily make sense --
> such as why the callCache count is so low compared to the line above
> when the hits value is so much larger.
>
> Also, on the same screen there is a section below that I believe is
> what the memory/cache settings are set to for the various memory/cache
> objects, however I cannot find where these are being set in the
> source.  I am looking for the UserDirectoryService memory/cache
> settings in particular.
>
> [ name = org.sakaiproject.user.api.UserDirectoryService status =
> STATUS_ALIVE eternal = false overflowToDisk = false
> maxElementsInMemory = 100000 maxElementsOnDisk = 0
> memoryStoreEvictionPolicy = LRU timeToLiveSeconds = 7200
> timeToIdleSeconds = 7200 diskPersistent = false
> diskExpiryThreadIntervalSeconds = 120 cacheEventListeners: hitCount =
> 548289 memoryStoreHitCount = 548289 diskStoreHitCount = 0
> missCountNotFound = 31318 missCountExpired = 4013 ]
> [ name = org.sakaiproject.user.api.UserDirectoryService.callCache
> status = STATUS_ALIVE eternal = false overflowToDisk = false
> maxElementsInMemory = 10000 maxElementsOnDisk = 0
> memoryStoreEvictionPolicy = LRU timeToLiveSeconds = 300
> timeToIdleSeconds = 300 diskPersistent = false
> diskExpiryThreadIntervalSeconds = 120 cacheEventListeners: hitCount =
> 1424509 memoryStoreHitCount = 1424509 diskStoreHitCount = 0
> missCountNotFound = 129340 missCountExpired = 26852 ]
>
> Does anyone know where these values are being set or if those are
> simply the defaults what needs to be placed in a .properties file to
> override them?
>
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

Regards

David



> Thanks!
>
> --
> Christopher Gross
> University of Florida
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100825/c0b17c5e/attachment.html 


More information about the sakai-dev mailing list