[jboss-user] [JBoss Cache Development] Document updated/added: "Extracting jbosscache async listener stats"

Daniel Cullender do-not-reply at jboss.com
Tue Feb 9 10:14:32 EST 2010


User development,

The document "Extracting jbosscache async listener stats", was updated Feb 9, 2010
by Daniel Cullender.

To view the document, visit:
http://community.jboss.org/docs/DOC-14766#cf

Document:
--------------------------------------------------------------
We are currently using jbosscache core 3.2.1.GA and currently push literally millions of records into it. We have asynchronous listeners processing the data as it is put into the cache.
 
The problem is that the listeners cannot process the data quickly enough and this causes a backlog in the async queue size (which is set to a number in the millions). Increasing the Async pool size over 250 does not help either based on the various (but necessary) locks we have in place.
 
In order to successfully manage the backlog, we needed to monitor the cache's Async Listener's Queue size to see when it grows to large. Unfortunately, we could not find a way to access these type of stats from the cache, so we downloaded the source code and exposed these stats ourselves.
 
*Code Modifications*
 
1. We created a new immutable VO called org.jboss.cache.notifications.NotifierRuntime which holds the various statistics relating to the async listener queue and pool
2. in the org.jboss.cache.notifications.NotifierImpl class, keep a reference to the ThreadPoolExecutor which the BoundedExecutor assigns to the asyncProcessor since this contains all the information you need to extract the queue size (along with other useful stats)
3. expose a method on the org.jboss.cache.notifications.Notifier interface and the org.jboss.cache.Cache interface to expose a method which returns this immutable object (org.jboss.cache.notifications.NotifierRuntime) which is populated with delicious data (Our object contains minimal info, but could easily be extended to expose a whole lot more data).
 
These statistics have helped us manage the backlog and keep our application afloat.
 
I have attached the source code and built jar for anyone who has a similar requirement.

--------------------------------------------------------------




More information about the jboss-user mailing list