From: Brian D. (JIRA) <jir...@jb...> - 2005-06-17 20:21:54
|
[ http://jira.jboss.com/jira/browse/JBCACHE-194?page=all ] Brian Dueck updated JBCACHE-194: -------------------------------- Attachment: LRUPolicy.java 3rd time lucky I hope... Minor changes in valid range checking, plus set the default to 1. > Provide configurable eviction thread priority boost > --------------------------------------------------- > > Key: JBCACHE-194 > URL: http://jira.jboss.com/jira/browse/JBCACHE-194 > Project: JBoss Cache > Type: Feature Request > Versions: 1.2, 1.2.1, 1.2.2, 1.2.3 > Reporter: Brian Dueck > Assignee: Ben Wang > Fix For: 1.2.4 > Attachments: LRUPolicy.java, LRUPolicy.java, LRUPolicy.java > > > In environments where there there are many TreeCache client threads accessing the cache concurrently, the eviction thread may become starved. In this situation, even setting the wakeupInterval to 1 or 2 seconds does not help because the OS won't allocate proportionally very much time to the waiting eviction thread in comparison to the other TreeCache client threads. > While there are some "fancy" solutions to this problem involving client threads being put to work to perform eviction, or having multiple eviction threads, one solution that help partially alleviate the problem is to boost the thread priority of the eviction thread. > This provides a clue to the OS that allows the eviction thread to be scheduled more CPU time relative to other threads in a CPU resource constrained situation. > This change involves switching from using the Java Timer object to using the Oswego ClockDaemon class instead. I've attached here a protoype implementation that reads a new XML configuration parameter (evictionPriorityBoost - if you can think of a better name, go ahead and rename it) and then boosts the eviction thread priority accordingly. > Here's an example of the new config param: > <attribute name="EvictionPolicyConfig"> > <config> > <attribute name="wakeUpIntervalSeconds">5</attribute> > <!-- boost the eviction thread by 2 --> > <attribute name="evictionPriorityBoost">2</attribute> > <!-- Cache wide default --> > <region name="/_default_"> > <attribute name="maxNodes">5000000</attribute> > <attribute name="timeToLiveSeconds">10</attribute> > </region> > </config> > </attribute> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |