]
Manik Surtani updated JBCACHE-194:
----------------------------------
Fix Version/s: 2.1.0.GA
(was: 2.0.0.GA)
Provide configurable eviction thread priority boost
---------------------------------------------------
Key: JBCACHE-194
URL:
http://jira.jboss.com/jira/browse/JBCACHE-194
Project: JBoss Cache
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Affects Versions: 1.2, 1.2.1, 1.2.2, 1.2.3
Reporter: Brian Dueck
Assigned To: Manik Surtani
Fix For: 2.1.0.GA
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: