A soft-locked cache entry was expired by the underlying Ehcache
症状
atlassian-stash.log
に次のメッセージが表示される。
2012-10-10 09:16:59,516 WARN [scheduler_Worker-5] n.s.e.h.s.AbstractReadWriteEhcacheAccessStrategy Cache com.atlassian.crowd.model.user.InternalUser.credentialRecords Key com.atlassian.crowd.model.user.InternalUser.credentialRecords#4718627 Lockable : null
A soft-locked cache entry was expired by the underlying Ehcache. If this happens regularly you should consider increasing the cache timeouts and/or capacity limits
2012-10-10 09:17:00,686 WARN [scheduler_Worker-5] n.s.e.h.s.AbstractReadWriteEhcacheAccessStrategy Cache com.atlassian.crowd.model.user.InternalUser Key com.atlassian.crowd.model.user.InternalUser#4423730 Lockable : null
A soft-locked cache entry was expired by the underlying Ehcache. If this happens regularly you should consider increasing the cache timeouts and/or capacity limits
原因
A soft-locked cache entry expired. These warning are known behavior in Stash and tend to happen when the Crowd user management component syncs with an external user directory and cycles through all the users quickly (thus evicting some users that may be needed in other requests operating at the same time). If you ignore these warnings then Stash will need to do make some extra calls to the database to retrieve user information. We do not believe these extra database calls would materially impact the performance of your Stash instance.
ソリューション
Stash 3.2+ no longer uses Ehcache. The default limit for the new caching framework is 2000 for both InternalUser
and InternalUser.credentialRecords
.
Increase the Ehcache maxElementsInMemory
limit to get rid of the WARNs:
- Edit the file
stash-1.3.00/atlassian-stash/WEB-INF/classes/ehcache.xml
inside the Stash Installation Directory - Locate the following classes: com.atlassian.crowd.model.user.InternalUser.credentialRecords and com.atlassian.crowd.model.user.InternalUser
<cache name="com.atlassian.crowd.model.user.InternalUser.credentialRecords"
eternal="false"
maxElementsInMemory="500" --> "1000"
timeToIdleSeconds="1800"
timeToLiveSeconds="1800"
overflowToDisk="false"
memoryStoreEvictionPolicy="LFU"/>
<cache name="com.atlassian.crowd.model.user.InternalUser"
eternal="false"
maxElementsInMemory="500" --> "1000"
timeToIdleSeconds="1800"
timeToLiveSeconds="1800"
overflowToDisk="false"
memoryStoreEvictionPolicy="LFU"/>
So basically the values are 500 and we are changing them to 1000 - restart Stash and that should make the WARNs to disapear from the logs.