CompressionEnabled

Topics: User Forum
Jun 8, 2009 at 3:33 PM

Can someone explain the 'CompressionEnabled' property?  How is it turned on/off and how can I tell if it is compressing data?  I have tried this:

  <indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider" CompressionEnabled="1" CompressionMinSize="1024">
....

</indexusNetSharedCache>

But that just throws an error (Unrecognized attribute 'CompressionEnabled'. Note that attribute names are case-sensitive.) and by putting it in the <appSettings> it didn't seem to have any effect. 

 

Thanks,

Shawn

Jun 8, 2009 at 7:02 PM

hi shawn,

can you please provide a bit more details?

your version and a full web.config entry ?

regards and thanks,

roni

Jun 8, 2009 at 7:32 PM

Roni,

My apologies.  I thought that it would have been something simple.  I am running on the most recent version (3.0.5.1) under IIS 7 (Vista 64-bit). Here is my web.config:

 <indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider">
    <!--<indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider" CompressionEnabled="1" CompressionMinSize="1024">-->

    <servers>
      <add key="SrvZh03" ipaddress="127.0.0.1" port="48888"/>
    </servers>
    <providers>
      <add name="IndexusSharedCacheProvider" type="SharedCache.WinServiceCommon.Provider.Cache.IndexusSharedCacheProvider, SharedCache.WinServiceCommon">
      </add>
    </providers>
  </indexusNetSharedCache>

Where the NetSharedCache tag is defined, you can see the commented out line that I had also tried.

I have the <appSettings> cleared out , but my previous settings where:

 

  <appSettings>
    <!--Version Number, same like in assemblies-->
    <add key="SharedCacheVersionNumber" value="3.0.5.1"/>
    <!--Should information be logged-->
    <add key="LoggingEnable" value="1"/>
    <!--Location of Cache Service-->
    <add key="ServiceCacheIpAddress" value="127.0.0.1"/>
    <!--Location of Cache Service, the port number-->
    <add key="ServiceCacheIpPort" value="48888"/>
    <!--
            Enable or disable compression upon client before transfer starts to server.
                Enable: 1
                Disable: 0           
        -->
    <add key="CompressionEnabled" value="1"/>
    <!--
            The user is able to set a min. size of its objects if the compression takes action or not.
            Size is defined in byte amount:
              1kb = 1024
             10kb = 10240
            hint 1: upon 0, every single payload will be compressed
            hint 2: upon negative numbers the compression will not work.
        -->
    <add key="CompressionMinSize" value="1024"/>
  </appSettings>

Thanks again,

Shawn

 

Jun 8, 2009 at 8:24 PM

This Version does not work with appSettings its working with the provider details.

Please check the following link: http://www.sharedcache.com/cms/shared_cache_configuration_server.aspx (my apologies at this place because this settings are not documented -> added this to my todo list)

Here a sample client config:

<configuration>
 <configSections>
  <section name="indexusNetSharedCache" type="SharedCache.WinServiceCommon.Configuration.Client.IndexusProviderSection, SharedCache.WinServiceCommon"/>  
 </configSections>
 <indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider">
  <clientSetting
    SharedCacheVersionNumber="3.0.5.2"
    LoggingEnable="1"
    CompressionEnabled="1"
    CompressionMinSize="1024000"
    
    HashingAlgorithm="Hashing"
    SocketPoolMinAvailableSize="5"
    SocketPoolValidationInterval="00:02:00"
    SocketPoolTimeout="00:02:00"
    EncryptionProviderHashSalt="roni"
    />
  <servers>
   <add key="localhost" ipaddress="127.0.0.1" port="48888"/>
   <!--<add key="Server01-Local" ipaddress="192.168.1.10" port="48888" />-->
  </servers>
  <replicatedServers>
   <!--<add key="srvzh02"  ipaddress="192.168.212.50" port="48888"/>-->
   <!-- only use this node in case you are using replication mode on server -->
   <!--<add key="Cluster02-Remote"  ipaddress="192.168.1.11" port="48888" />-->
   <!--<add key="Cluster03-Remote"  ipaddress="192.168.1.12" port="48888" />-->
  </replicatedServers>
  <providers>
   <add
    name="IndexusSharedCacheProvider"
    type="SharedCache.WinServiceCommon.Provider.Cache.IndexusSharedCacheProvider, SharedCache.WinServiceCommon"
           >
   </add>
  </providers>
 </indexusNetSharedCache>
<configuration> 

    CompressionEnabled="1"
    CompressionMinSize="1024000"
    

With CompressionEnabled="1" you activate the check of your object. Over the CompressionMinSize="1024000" you set the minimal size when it runs the compression. In my tests I recognized that sometimes

it better to set this boundry quite high because your server  needs a lot of CPU for that compression stuff. Its actually the same like you enable on IIS Compression its always something you have to test if you not

run into high CPU load because of this setting.

From my experience with somebody else, if you have a lot of images you keep in your cache then it does not really make a lot of difference.

The above config sample is from the test program, you can test this behaviours with the test application option: 400 Compare Compression Usage (remember first to activate the Compression setting)

hope the stuff above helps

regards,

roni