2011-06-21 16 views
0

Tomcat 7環境に展開された複製されたehcacheを使用しています。ここで起こるのは、Tomcatが起動に時間がかかり、ログがehcacheのハートビートメッセージでいっぱいになるということです。Tomcatの起動時にEhcacheのクラスタが長くかかる

ehcacheとTomcatの起動をどのようにスピードアップできるかについてのご意見はありますか?

マイehcache.xml - あなたは非同期にブートストラップ戦略を変更する必要が

<?xml version="1.0" encoding="UTF-8"?> 

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:noNamespaceSchemaLocation="ehcache.xsd" 
     updateCheck="true" monitoring="autodetect" 
     dynamicConfig="true"> 

    <diskStore path="java.io.tmpdir"/> 

    <transactionManagerLookup class="net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup" 
           properties="jndiName=java:/TransactionManager" propertySeparator=";"/> 
    <cacheManagerEventListenerFactory class="com.adobe_services.cache.SampleCacheManagerEventListenerFactory" properties="type=counting"/> 
    <cacheManagerPeerProviderFactory 
      class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" 
      properties="peerDiscovery=automatic, 
         multicastGroupAddress=230.0.0.1, 
         multicastGroupPort=4446, timeToLive=1" 
      propertySeparator="," 
      /> 
    <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" 
            properties="hostName=, port=, socketTimeoutMillis="/> 
    <defaultCache 
      maxElementsInMemory="10000" 
      eternal="false" 
      timeToIdleSeconds="120" 
      timeToLiveSeconds="120" 
      overflowToDisk="true" 
      diskSpoolBufferSizeMB="30" 
      maxElementsOnDisk="10000000" 
      diskPersistent="false" 
      diskExpiryThreadIntervalSeconds="120" 
      memoryStoreEvictionPolicy="LRU" 
      statistics="false" 
      /> 

    <cache name="replicatedCache" 
    maxElementsInMemory="5" 
      maxElementsOnDisk="100000" 
      eternal="true" 
      overflowToDisk="true" 
      diskPersistent="true" 
      diskSpoolBufferSizeMB="20" 
      timeToIdleSeconds="3600" 
      timeToLiveSeconds="3600" 
      memoryStoreEvictionPolicy="LFU" 
      transactionalMode="off"> 
     <cacheEventListenerFactory 
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/> 
     <bootstrapCacheLoaderFactory 
     class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" 
     properties="bootstrapAsynchronously=false, maximumChunkSizeBytes=5000000" 
     propertySeparator="," /> 
    </cache> 

    <cache name="replicatedCache2" 
    maxElementsInMemory="5" 
      maxElementsOnDisk="100000" 
      eternal="true" 
      overflowToDisk="true" 
      diskPersistent="true" 
      diskSpoolBufferSizeMB="20" 
      timeToIdleSeconds="3600" 
      timeToLiveSeconds="3600" 
      memoryStoreEvictionPolicy="LFU" 
      transactionalMode="off"> 
     <cacheEventListenerFactory 
       class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"/> 
     <bootstrapCacheLoaderFactory 
     class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" 
     properties="bootstrapAsynchronously=false, maximumChunkSizeBytes=5000000" 
     propertySeparator="," /> 
    </cache> 


</ehcache> 
+0

あなたにehcache設定例を投稿することができますか? –

+0

@Andrey Adamovich - 元の質問を更新しています。 – Pushkar

+1

キャッシュ構成からブートストラップローダーを削除する方法はありますか? –

答えて

3

bootstrapAsynchronously=true)起動時の遅延を回避するためにすなわち:

<bootstrapCacheLoaderFactory 
     class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" 
     properties="bootstrapAsynchronously=true, maximumChunkSizeBytes=5000000" 
     propertySeparator="," /> 
関連する問題