data been replicated on replication server slowly

Topics: Developer Forum, User Forum
Sep 26, 2012 at 4:16 PM
Edited Sep 26, 2012 at 4:18 PM

Hello All,

I am trying to create a demo using SharedCache.

1. I have configured two servers, one acts as main server and other acts as replicated server. Following are the config section.

-> Config of main server:

 

<replicatedSharedCache defaultProvider="ServerSharedCacheProvider">
    <serverSetting 
			ServiceCacheIpAddress="xxx.xxx.xxx.66" 
			ServiceCacheIpPort="58888" 
			SharedCacheVersionNumber="3.0.5.1" 
			LoggingEnable="1" 
			ServiceFamilyMode="1" 
			CacheAmountOfObjects="-1" 
			CacheAmountFillFactorInPercentage="90" 
			ServiceCacheCleanup="LRU" 
			ServiceCacheCleanupThreadJob="3600000"
			TcpServerMaxThreadToSet="-1" 
			TcpServerMinThreadToSet="-1"
			SocketPoolMinAvailableSize="25"
			SocketPoolValidationInterval="01:00:00"
			SocketPoolTimeout="01:00:00"
			/>
		<!--
			SocketPoolMinAvailableSize="5"
			SocketPoolValidationInterval="00:02:00"
			SocketPoolTimeout="00:02:00"
		-->
    <replicatedServers>
      <add key="SrvZh02" ipaddress="xxx.xxx.xxx.113" port="58888" />
      <!-- DO NOT DEFINE THE INSTANCE ITSELF !!! IT WILL BE AUTOMATICALLY REMOVED AT RUNTIME -->
    </replicatedServers>

-> Config of replicated server:

 

 

<replicatedSharedCache defaultProvider="ServerSharedCacheProvider">
    <serverSetting 
			ServiceCacheIpAddress="xxx.xxx.xxx.113" 
			ServiceCacheIpPort="58888" 
			SharedCacheVersionNumber="3.0.5.1" 
			LoggingEnable="1" 
			ServiceFamilyMode="1" 
			CacheAmountOfObjects="-1" 
			CacheAmountFillFactorInPercentage="90" 
			ServiceCacheCleanup="LRU" 
			ServiceCacheCleanupThreadJob="3600000"
			TcpServerMaxThreadToSet="-1" 
			TcpServerMinThreadToSet="-1"
			SocketPoolMinAvailableSize="25"
			SocketPoolValidationInterval="01:00:00"
			SocketPoolTimeout="01:00:00"
			/>
		<!--
			SocketPoolMinAvailableSize="5"
			SocketPoolValidationInterval="00:02:00"
			SocketPoolTimeout="00:02:00"
		-->
    <replicatedServers>
      <add key="SrvZh02" ipaddress="xxx.xxx.xxx.66" port="58888" />
      <!-- DO NOT DEFINE THE INSTANCE ITSELF !!! IT WILL BE AUTOMATICALLY REMOVED AT RUNTIME -->
    </replicatedServers>

 

2. I have also setup one client (config as below):

 

<indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider">
    <clientSetting SharedCacheVersionNumber="3.0.5.1" LoggingEnable="1" CompressionEnabled="0" CompressionMinSize="1024000" HashingAlgorithm="Hashing" SocketPoolMinAvailableSize="25" SocketPoolValidationInterval="00:20:00" SocketPoolTimeout="00:20:00"/>
   
    <servers>
      <add key="localhost" ipaddress="xxx.xxx.xxx.66" port="58888"/>
      
    </servers>
    <replicatedServers>
      <add key="srvzh02" ipaddress="xxx.xxx.xxx.113" port="58888" />
     
    </replicatedServers>
    <providers>
      <add name="IndexusSharedCacheProvider" type="SharedCache.WinServiceCommon.Provider.Cache.IndexusSharedCacheProvider, SharedCache.WinServiceCommon"/>
    </providers>
  </indexusNetSharedCache>

 

 

========================================

 

Now in the client I am creating object of dummy class "Person" and running a loop from 1 to 100000, assigning values to object of class "Person" and adding that in the cache, so in short I am adding 100000 objects (data) in cache.

Next I am trying to get the count of objects (data) added in cache using GetAllKeys() method (as below):

List<string> lstKeys = IndexusDistributionCache.SharedCache.GetAllKeys("xxx.xxx.xxx.66");
Literal1.Text = Convert.ToString(lstKeys.Count);

If we note, I am getting all keys from main server defined (IP - xxx.xxx.xxx.66) and I get the proper count i.e. 100000

But if I try to get all keys from replicated server using IP - xxx.xxx.xxx.113 as GetAllKeys("xxx.xxx.xxx.113".

I do not get the count (100000) immediately, rather the count is increasing slowly

So, data is not getting replicated immediately on replication server and all total 100000 records get replicated after almost 20 minutes.