Skip Navigation Links

Why use shared cache?

There is no more efficient way to increase the scalable performance of applications then the use caching to unload deeper layers.

Skip Navigation Links>> Shared Cache>> Shared Cache Config>> Configuration Server>> Distributed Caching

Distributed Caching Configuration

In Shared Cache Topology section we have listed advanteges of distributed caching. Lets assume we have 3 IIS WebServers in the same zone and we want to configure them for distributed caching where on each server an instance of indeXus.Net Shared Cache Server is installed.

Server details:

Server no. 1

Server no. 2

Server no. 3

  • Name: WebSrv20
  • IP: 192.168.1.20
  • Name: WebSrv30
  • IP: 192.168.1.30
  • Name: WebSrv40
  • IP: 192.168.1.40

Updating your configuration file: 

After you installed successfully indeXus.Net Shared Cache on each of your servers you find in the installation folder a config file: MergeSystem.Indexus.WinService.exe.config. The configuration file provided as-is and need always be configured.

Upon distributed caching you can configure the file once and drop it afterwards to all your servers since there are no special configuration available per instance and connectivity between the server nodes.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
    <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
    <section name="replicatedSharedCache" 
         type="    />
MergeSystem.Indexus.WinServiceCommon.Configuration.
Server.IndexusServerProviderSection, 
MergeSystem.Indexus.WinServiceCommon"
</configSections>
<appSettings/>        
<replicatedSharedCache defaultProvider="ServerSharedCacheProvider">
    <serverSetting
    ServiceCacheIpAddress="127.0.0.1"
    ServiceCacheIpPort="48888"
    SharedCacheVersionNumber="2.0.3.268"
    LoggingEnable="1"
    ServiceFamilyMode="0"
    CacheAmountOfObjects="200"
    CacheAmountFillFactorInPercentage="90"
    ServiceCacheCleanup="LRU"
    ServiceCacheCleanupThreadJob="1"
    TcpServerMaxThreadToSet="-1"
    TcpServerMinThreadToSet="-1"
    />
    <replicatedServers />
    <providers>
    <add
    name="ServerSharedCacheProvider"        
    type=">
MergeSystem.Indexus.WinServiceCommon.
Provider.Server.IndexusServerSharedCacheProvider,
MergeSystem.Indexus.WinServiceCommon"
    </add>
</providers>
</replicatedSharedCache>
<nlog autoReload="true" throwExceptions="true">
    <targets async="true">
    <target 
    name="shared_cache_general"
    type="File" 
    layout="${longdate}|${level:uppercase=true}|${aspnet-request:item=logSession}|${message}"
    filename="C:\temp\logs\server\${date:format=yyyy-MM-dd}_shared_cache_general_log.txt"/>
    <target 
    name="shared_cache_traffic"
    type="File" 
    layout="${longdate}|${level:uppercase=true}|${aspnet-request:item=logSession}|${message}"
    filename="C:\temp\logs\server\${date:format=yyyy-MM-dd}_shared_cache_traffic_log.txt"/>
    <target 
    name="shared_cache_tracking"
    type="File" 
    layout="${longdate}|${level:uppercase=true}|${aspnet-request:item=logSession}|${message}"
    filename="C:\temp\logs\server\${date:format=yyyy-MM-dd}_shared_cache_tracking_log.txt"/>
    <target 
    name="shared_cache_sync"
    type="File" 
    layout="${longdate}|${level:uppercase=true}|${aspnet-request:item=logSession}|${message}"
    filename="C:\temp\logs\server\${date:format=yyyy-MM-dd}_shared_cache_sync_log.txt"/>
    <target 
    name="shared_cache_memory"
    type="File" 
    layout="${longdate}|${level:uppercase=true}|${aspnet-request:item=logSession}|${message}"
    filename="C:\temp\logs\server\${date:format=yyyy-MM-dd}_shared_cache_memory_log.txt"/>
    </targets>
    <rules>
    <logger name="General" minlevel="Debug" 
    writeTo="shared_cache_general" final="true"/>
    <logger name="Traffic" minlevel="Debug" 
    writeTo="shared_cache_traffic" final="true"/>
    <logger name="Tracking" minlevel="Debug" 
    writeTo="shared_cache_tracking" final="true"/>
    <logger name="Sync" minlevel="Debug" 
    writeTo="shared_cache_sync" final="true"/>
    <logger name="Memory" minlevel="Debug" 
    writeTo="shared_cache_memory" final="true"/>
    <logger name="*" minlevel="Debug" 
    writeTo="shared_cache_general"/>
    <logger name="*" minlevel="Info" 
    writeTo="shared_cache_general"/>
    </rules>
</nlog>

Configurations

The only changes you will make in this file is within one of the following sections: serverSetting or nlog everything else you don't need to change. The various options are within the serverSetting are explained over here.

Nlog Tipp

We suggest to make a clear seperation between client and server log files if you are enable logging. This can be done easly by using seperated folders. In general you should take care that logging, even if its used in async mode can be very extensive.

Client Configuration

Check the following section.