2 Replies Latest reply on Jan 13, 2012 11:28 AM by shawny

    Event "CacheEntryCreatedEvent" VS  Cache size

    shawny

      I have a producer which will put entry into default cache, i have a consumer which will handle "CacheEntryCreatedEvent" event on default cache.

       

      At the end of producer, it will print the cache size and the total number of entries (e.g: 1000).

       

      Thead 29, counter size: 100, put ops: 1111/s

      Thead 29, counter size: 200, put ops: 1574/s

      Thead 29, counter size: 300, put ops: 1796/s

      Thead 29, counter size: 400, put ops: 1809/s

      Thead 29, counter size: 500, put ops: 1851/s

      Thead 29, counter size: 600, put ops: 2000/s

      Thead 29, counter size: 700, put ops: 2083/s

      Thead 29, counter size: 800, put ops: 2133/s

      Thead 29, counter size: 900, put ops: 2179/s

      Thead 29, counter size: 1000, put ops: 2188/s

      Thead 29, counter: 1000, cache size: 922 don

      Thead 29, counter: 1000, cache size: 922

       

       

      I find that the consumer will only get some of cache entries, why it can't get all of entries from cache? why the cache size is 922, not 1000.

       

      counter size: 2, get ops: 181/s

      counter size: 4, get ops: 114/s

      counter size: 6, get ops: 130/s

      counter size: 8, get ops: 137/s

      counter size: 10, get ops: 147/s

      counter size: 12, get ops: 137/s

      counter size: 14, get ops: 147/s

      counter size: 16, get ops: 150/s

      counter size: 18, get ops: 152/s

      counter size: 20, get ops: 156/s

      counter size: 22, get ops: 161/s

      counter size: 24, get ops: 160/s

      counter size: 26, get ops: 164/s

      counter size: 28, get ops: 167/s

      counter size: 30, get ops: 169/s

      counter size: 32, get ops: 172/s

      counter size: 34, get ops: 174/s

      counter size: 36, get ops: 174/s

      counter size: 38, get ops: 177/s

      counter size: 40, get ops: 180/s

      counter size: 42, get ops: 178/s

      counter size: 44, get ops: 179/s

      counter size: 46, get ops: 178/s

      counter size: 48, get ops: 177/s

      counter size: 50, get ops: 175/s

      counter size: 52, get ops: 177/s

      counter size: 54, get ops: 175/s

      counter size: 56, get ops: 175/s

      counter size: 58, get ops: 175/s

      counter size: 60, get ops: 178/s

      counter size: 62, get ops: 178/s

      counter size: 64, get ops: 175/s

      counter size: 66, get ops: 175/s

      counter size: 68, get ops: 176/s

      counter size: 70, get ops: 175/s

      counter size: 72, get ops: 175/s

      counter size: 74, get ops: 176/s

      counter size: 76, get ops: 177/s

      counter size: 78, get ops: 179/s

        • 1. Re: Event "CacheEntryCreatedEvent" VS  Cache size
          galder.zamarreno

          maxEntries is used as guide for the entire cache, but eviction happens on a per cache segment, so when the segment is full, the segment is evicted. That's why maxEntries is a theoretical limit but in practical terms, it'll be a bit less than that. This is done for performance reasons.

          • 2. Re: Event "CacheEntryCreatedEvent" VS  Cache size
            shawny

            I am not very understand.

             

             

            In my case, the producer is running on a jvm, the consumer is running on another jvm.

             

            and the infinispan mode is distribution mode, not eviction mode.

             

            <infinispan

                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                  xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"

                  xmlns="urn:infinispan:config:5.0">

             

             

               <global>

                  <transport>

                     <properties>

                        <property name="configurationFile" value="/home/xuanhouysh/workspace/scala/infinispan_test/conf/jgroups-tcp.xml" />

                     </properties>

                  </transport>

               </global>

             

             

               <default>

                  <clustering mode="distribution">

                     <l1 enabled="false" />

                     <hash numOwners="1"/>

                     <async>

                  </clustering>

               </default>

             

             

            </infinispan>