4 Replies Latest reply on Mar 18, 2005 1:13 PM by Abby Pad

    Some JBOSSCache questions...

    Abby Pad Newbie

      Ok, so now that I have successfully implemented a plain JBossCache within JBoss 3.2.6, I have some basic, performance related questions.
      1. In the plain JBossCache, it looks like I need to do a put everytime after an object is changed. Is that right? For example, if I have a vector assigned as value to a key, then in order to add an element in the vector, I need to do a put(fqn, key, myVector) after every change. Am I correct?
      2. If #1 is correct, then does the replication take place on the entire object every time, or does is somehow only replicate the incrementals?
      3. I am mostly using JBossCache to store the state information of my class. Right now, the class is a POJO. What is better performance wise - convert the POJO into a stateful session bean and use SFSN in state memory replication, or use TreeCache?
      4. Are there any performance timings/statistics available for put and get using plain TreeCache?
      5. What is the performance impact of doing a get on the TreeCache vs doing a get on a local hashmap? Is it worthwhile to invalidate the cache and only get values from cache is something has changed?

      I guess thats a lot of questions. All answers are deeply appreciated.

        • 1. Re: Some JBOSSCache questions...
          Ben Wang Master

          To answer some of your questions:

          1. Yes. You will need to specifically do a put whenever your object has been modified.

          2. Replication takes place for the whole myVector in your case.

          (This is where TreeCacheAop comes where you can do fine-grain replication.)

          3. SFSN will manage the state change for you vs. you will need to manage yourself (unless again you are using aop for fine grain replication).

          4. We have some old numbers on 2 nodes replication. But it's outdated so we will be working with new ones now.


          • 2. Re: Some JBOSSCache questions...
            Abby Pad Newbie

            Thank you for the quick response Ben. That helps. My main concerns are in the area of performance.

            From what I read, if I use the cache loader, then every single node is persisted on a backend store. Correct? Will that not be a big dent on performance?

            What if I dont have/want a cache loader? Will the nodes still get evicted? If so, am I losing those values? What happens if I dont have a cache loader, and node gets evicted, and a client asks for those values?

            When will the nodes get evicted if I set the max number of nodes to 0 (unlimited)? Is there a memory limit that I can set?

            Is it possible to only persist the evicted nodes into the persistent store instead of all the nodes? This would be like the passivation of a session bean.

            I apologize if any or all of my questions are naive.


            • 3. Re: Some JBOSSCache questions...
              Ben Wang Master

              1. Yes, using cacheloader implies every put is persisted so it has performance implication.

              2. If the node is evicted and not persisted, it will return null. So it is application responsibility to check this.

              3. We have overflowing persistence (or passivation) feature in our roadmap.


              • 4. Re: Some JBOSSCache questions...
                Abby Pad Newbie

                Thank you. I would like to know about some production level deployments.

                How many nodes, (with small objects associated) is typically recommended in a tree cache? Maybe a range would give me a better idea.

                Are there any best practices for using TreeCache?