문제

Does Windows Server AppFabric Cache compression cause data to be stored compressed or just transmitted compressed?

Is it intended to just save network bandwidth or both bandwidth and server memory ?

Note this is a Windows Server AppFabric question.

도움이 되었습니까?

해결책

Yes, because data is compressed on the client.

A really simple way to check this is to CmdLet Get-CacheStatistics.

    DataCacheServerEndpoint[] servers = new DataCacheServerEndpoint[1];
    servers[0] = new DataCacheServerEndpoint("fr-vmrd-web1", 22233);
    DataCacheFactoryConfiguration factoryConfig = new DataCacheFactoryConfiguration();
    factoryConfig.Servers = servers;
    factoryConfig.SecurityProperties = new DataCacheSecurity(DataCacheSecurityMode.None, DataCacheProtectionLevel.None);
    factoryConfig.TransportProperties.MaxBufferSize = int.MaxValue;
    factoryConfig.TransportProperties.MaxBufferPoolSize = int.MaxValue;
    factoryConfig.IsCompressionEnabled = true;//or false
    DataCacheFactory mycacheFactory = new DataCacheFactory(factoryConfig);

    var data = File.ReadAllText(@"c:\test.log"); //40 MB
    DataCache myDefaultCache = mycacheFactory.GetDefaultCache();
    myDefaultCache.Put("test", data);

With Compression

...
Size              : 2575360
ItemCount         : 1
RegionCount       : 1
...

Without Compression

...
Size              : 41900032
ItemCount         : 1
RegionCount       : 1
...

Hope this will help you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top