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.
>> Shared Cache>> Shared Cache Config>> Configuration Client
indeXus.Net Shared Cache Client configuration
configSection Element
In this section we able to defined additional config elements within the app.config or web.config file and in the section below we configure indexusSharedCache and nlog. indeXus.Net Shared Cache will use this configuration upon runtime - check msdn for more information about custom provider setions ( http://msdn2.microsoft.com/en-us/library/aa903350.aspx )
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
<section name="indexusNetSharedCache" type="/>
MergeSystem.Indexus.WinServiceCommon.Configuration.
Client.IndexusProviderSection,
MergeSystem.Indexus.WinServiceCommon"
</configSections>
|
indexusNetSharedCache Section
the section is splitted into 3 main parts:
- clientSetting - general settings
- servers - server nodes to use for distributed caching, upon replicated this will contain only one item
- replicatedServers - all replicated servers in your environment
The sample below can be taken for distributed caching in your environment.
<indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider">
SharedCacheVersionNumber="2.0.3.268"
CompressionMinSize="1024000"
SocketPoolMinAvailableSize="5"
HashingAlgorithm="Hashing" />
<add key="WebSrv20" ipaddress="192.168.1.20" port="48888" />
<add key="WebSrv30" ipaddress="192.168.1.30" port="48888" />
<add key="WebSrv40" ipaddress="192.168.1.40" port="48888" />
<!-- only use this node in case you are using replication mode on server -->
name="IndexusSharedCacheProvider"
MergeSystem.Indexus.WinServiceCommon.Provider.
Cache.IndexusSharedCacheProvider,
MergeSystem.Indexus.WinServiceCommon"
|
clientSetting
- SharedCacheVersionNumber - this is used for logging
- LoggingEnable - enable or disable logging - 1 - enable; 0 - disable
- CompressionEnabled - if you work with heavy objects then compression can reduce the payload of each action by 25 - 35%.
- CompressionMinSize - define the min. size of an object payload when to use compression. We use 1MB (1024000) normally but in some cases we figured out that it makes sense to use it already with smaller sizes. We suggest to make tests how you should configure it if you gone use it.
- SocketPoolMinAvailableSize - Client connection pooling contains a an amount of open connections to each configured server, the best value is 5. Connections which not used for more then 2 minutes are closed automatically for security purposes.
- HashingAlgorithm - You can choose which algorithm you like to use for hashing
servers
As you see in above sample, each server has a combination of Key, IpAddress and Port. Upon replication configuration this section only contain 1 element and and all replicated servers are available in replicatedServers node.
replicatedServers
replicatedServers is used while you configure your system for replication. In case the main server is down the connection pooling is smart enough to make a failover and access one of the replicatedServers to receive your information.