1 2 Previous Next 17 Replies Latest reply on May 31, 2012 7:20 AM by bramalingam81 Go to original post
      • 15. Re: Infinispan 5.1.4.Final  + JGroups 3.0.9.Final
        bramalingam81

        Thanks Martin ! It was my mistake in printing the transaction manager ! Now that I am simulating for a load of 5 Lakhs(0.5 million) request & my tomcat memory capped @ 2GB, this configuration goes Out of memory. Max entries - 1.8 million, with each lifespan of key being 6 minutes, Could there be a problem with my eviction or loader configuration ?

         

        <eviction strategy="LIRS" maxEntries="1800000" />

                            <expiration maxIdle="240000" wakeUpInterval="10000"

                                      lifespan="360000" reaperEnabled="true" />

                            <clustering mode="distribution">

                                      <stateTransfer fetchInMemoryState="true" timeout="300000"

                                                chunkSize="512" />

                                      <!--<async asyncMarshalling="false" useReplQueue="false" replQueueInterval="10"

                                                replQueueMaxElements="1000" /> -->

                                      <sync replTimeout="25000" />

                                      <l1 enabled="false" lifespan="180000" onRehash="false" />

                                      <hash numVirtualNodes="3" numOwners="2" />

                            </clustering>

                            <loaders passivation="true" shared="false" preload="false">

                                      <loader class="org.infinispan.loaders.file.FileCacheStore"

                                                fetchPersistentState="false" ignoreModifications="true"

                                                purgeOnStartup="true" purgerThreads="25">

                                                <properties>

                                                          <property name="location" value="/home/verse-staging/" />

                                                </properties>

                                      </loader>

                            </loaders>

                            <locking writeSkewCheck="false" useLockStriping="false"

                                      lockAcquisitionTimeout="60000" isolationLevel="READ_COMMITTED"

                                      concurrencyLevel="1000" />

                            <transaction useSynchronization="true" transactionMode="TRANSACTIONAL"

                                      useEagerLocking="false"

                                      transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"

                                      use1PcForAutoCommitTransactions="false" syncRollbackPhase="false"

                                      syncCommitPhase="true" lockingMode="OPTIMISTIC" eagerLockSingleNode="true"

                                      cacheStopTimeout="30000" autoCommit="false">

                            </transaction>

         

         

        Thank you !

        • 16. Re: Infinispan 5.1.4.Final  + JGroups 3.0.9.Final
          mgencur

          Glad that we solved that:)

           

          I don't think there is a problem with your configuration. You simply need to increase your JAVA_OPTS limits or decrease maxEntries in order to avoid Out of memory. Infinispan does not yet support eviction based on memory usage.

          • 17. Re: Infinispan 5.1.4.Final  + JGroups 3.0.9.Final
            bramalingam81

            This is my JAVA_OPTS :

             

            JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"

             

            JAVA_OPTS="$JAVA_OPTS -Xms2048m -Xmx2048m -Xss1024k -XX:PermSize=512m -XX:MaxPermSize=512m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:ParallelGCThreads=23 -XX:MaxTenuringThreshold=10 -XX:+HeapDumpOnOutOfMemoryError -Xloggc:gc_server_log.log -XX:-UseGCOverheadLimit -Djava.endorsed.dirs='$JAVA_ENDORSED_DIRS' -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+PrintGCTaskTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:gc_server_log.log"

             

            I have set my tomcat to max of 2GB of memory. I am just thinking on whether eviction is really happening or NOT. As per the heap analyser, 94% of the heap is being occupied by DefaultDataContainer Object. This object has all ImmortalCacheEntry and ImmortalCacheValue Objects. As these are immortal, I believe the eviction is not happening !

             

            I have not configured the data container as part of the configuration file. Is that something that I am missing !

             

            With the above java opts parameter, when I tried for max entries of 12lakh keys with each unique entry (key+value) being 120 character, load test ran out of memory after 2.7 lakhs entries. When I viewed the heap dump it was all occupied by DefaultDataContainer Objects.

             

            Moreover, as per my configuration,  as the passivation is enabled, entries once evicted should be available in the filestore that is configured. I ran a test case to check if the eviction is happening and on eviction whether the key is available in the file store or not. If the key is available in the file store before the lifespan for the key expires, it should return the value of that key. However, this did not happen !

             

              <eviction strategy="LIRS" maxEntries="5" />

                                <expiration maxIdle="500" wakeUpInterval="500" lifespan="300000"

                                          reaperEnabled="true" />

             

            @Test

                public void infiniSpanCache() throws IOException, InterruptedException, SystemException

                {

                    EmbeddedCacheManager manager = new DefaultCacheManager("infinispan-cluster.xml");

                    Cache<String, String> cache = manager.getCache("application-cache");

                    @SuppressWarnings("rawtypes")

                    TransactionManager tm = ((CacheImpl) cache).getAdvancedCache().getTransactionManager();

                    System.out.println("Transaction: " + tm.getClass().getName());

                    System.out.println("Cache Implementation = " + cache);

                    try

                    {

                        tm.begin();

                        System.out.println("Txn within TM = " + tm.getTransaction().toString());

                        // Add a entry

                        cache.put("key", "value");

                        for (int i = 0; i < 7; i++)

                        {

                            cache.put("element" + i, "value" + i);

                        }

                        System.out.println("First In Element is " + cache.get("element0"));

                        // cache.put("element5000", "value5000");

                        // Validate the entry is now in the cache

                        tm.commit();

                    }

                    catch (Exception e)

                    {

                        try

                        {

                            if (tm != null)

                            {

                                tm.rollback();

                            }

                        }

                        catch (Exception ex)

                        {

                        }

                    }

                    System.out.println("Eviction Thread is waking up......");

                    Thread.sleep(500);

                    System.out.println("First In Element is " + cache.get("element0")); - I was expecting the key to be available here as the file store should have the key ! and the life span(5 minutes) for that key is still available. But it returned null.

                    Thread.sleep(500);

                    System.out.println("First In Element is " + cache.get("element0"));

             

             

                }

             

            Please let me know If I am missing something.  Thank you so much on your timely help !

            1 2 Previous Next