2 Replies Latest reply on May 16, 2007 11:00 AM by manik

    Better way to use multiple caches?

    jorgemoralespou_2

      Hi,
      I`m using JBC 1.4.1.SP3 in my app. As the cache needs are very intensive and we have needs for different types of constraints on cache, and also every app we deploy is in need to have a customized cache, I`m wondering which is better in terms of performance and reliability.

      * To have one cache with multiple regions, each of which is configured with different eviction policies, different activation/inactivation times, etc...

      * To have one cache per web-app, which in terms of network traffic for replication can be more intensive.

      Either way we have constraints to have som caches persisted to database, some not. Any of them with different eviction policies per region. We are talking of about a cache with 200 different top-region or 200 different caches.

      Thank you for your help.

        • 1. Re: Better way to use multiple caches?
          genman

          Likely, nobody including the devs have tested 200 separate cache instances versus a cache with 200 regions.

          Given that there are limitations on what you can do within a region, specifically you can't configure a per-region cache loader yet, you would need separate cache instances.

          I can't see anything wrong with 200 cache instances, just potential headaches with dealing with configuration. You do lose a bit of efficiency, in terms of memory.

          What might be a good compromise would be to create about 10 different "flavors" of caches and share these amongst the 200 applications.

          • 2. Re: Better way to use multiple caches?
            manik

            What you could also do is multiplex over a single JGroups channel. This way 200 caches share a single network socket for comms.

            Although I doubt the JGroups multiplexer has been stressed with 200 caches! ;)

            See: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheMultiplexer