设置appfabric支持大数据量

设置内存为2G ,客户端和服务器都要设置

<advancedProperties>

            <securityProperties mode="None" protectionLevel="None" />
     <transportProperties maxBufferSize="2000000000"/>
        </advancedProperties>

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

附录:

缓存客户端设置

设置XML 配置位置代码配置位置

客户端超时(毫秒)

dataCacheClient 元素中的 requestTimeout 属性。我们不建议指定小于 10000(10 秒)的值。默认值为 15000

DataCacheFactoryConfiguration 类的 RequestTimeout 属性。

频道打开超时(毫秒)

dataCacheClient 元素中的 channelOpenTimeout 属性。可以将该值设置为 0 以便立即处理任何网络问题。有关详细信息,请参阅 配置缓存客户端超时(Windows Server AppFabric 缓存)。默认值为3000

DataCacheFactoryConfiguration类的 ChannelOpenTimeout 属性。

与服务器的最大连接数

dataCacheClient 元素中的 maxConnectionsToServer 属性。默认值为 1

DataCacheFactoryConfiguration类的 MaxConnectionsToServer 属性。

缓存主机设置

设置XML 配置位置代码配置位置

缓存服务器名称

host 元素的 name 属性。

DataCacheServerEndpoint 类的 HostName 属性。

缓存端口号

host 元素的 cachePort 属性。

DataCacheServerEndpoint 类的 CachePort 属性。

 本地缓存设置

设置XML 配置位置代码配置位置

本地缓存已启用

localCache 元素中的 isEnabled 属性。值可以是 true 或 falselocalCache元素也可能缺失,以表明该元素已禁用。

DataCacheLocalCacheProperties 类的 IsEnabled 属性。然后,这将分配给 DataCacheFactoryConfiguration 类的 LocalCacheProperties 属性。

本地缓存失效方法

localCache 元素中的 sync 属性。TimeoutBased 值用于表明应使用超时值。NotificationBased 用于表明还应使用缓存通知。

DataCacheLocalCacheProperties 类的InvalidationPolicy 属性。可能的值包括NotificationBased 和 TimeoutBased

本地缓存超时(秒)

localCache 元素中的 ttlValue 属性。

DataCacheLocalCacheProperties 类的 DefaultTimeout属性。

指定缓存通知轮询时间间隔(秒)

(可选)由 clientNotification 元素的 pollInterval 属性指定。clientNotification 元素是 dataCacheClient 元素的子,而非 localCache元素的子。如果未指定,则将使用值 300 秒。

DataCacheNotificationProperties 类的 PollInterval 属性。然后,这将分配给DataCacheFactoryConfiguration 类的NotificationProperties 属性。

本地缓存对象的最大计数

(可选)由 localCache 元素中的 objectCount 属性指定。本地缓存上应启动逐出时进行触发;然后它将尝试删除最近最少使用的 20% 的本地缓存对象。如果未指定,则使用默认值 10,000 个对象。

DataCacheLocalCacheProperties 类的 ObjectCount 属性。

通知设置

设置XML 配置位置代码配置位置

特定缓存通知轮询时间间隔(秒)

由 clientNotification 元素的 pollInterval 属性指定。如果未指定,则将使用值 300 秒。

DataCacheNotificationProperties 类的 PollInterval 属性。然后,这将分配给DataCacheFactoryConfiguration 类的 NotificationProperties 属性。

最大队列长度

clientNotification 元素的 maxQueueLength 属性。如果未指定,则默认值为 10000。

DataCacheNotificationProperties 类的 MaxQueueLength 属性。

安全设置

设置XML 配置位置代码配置位置

模式

securityProperties 元素的 mode 属性。可能的值包括Transport 和 None。默认值为 Transport

DataCacheSecurity 类的 SecurityMode 属性。可能的值包括 None 和 Transport。然后,将 DataCacheSecurity 对象分配给 DataCacheFactoryConfiguration 类的SecurityProperties 属性。

保护级别

securityProperties 元素的 protectionLevel 属性。可能的值包括 NoneSign 和 EncryptAndSign。默认值为EncryptAndSign

DataCacheSecurity 类的 ProtectionLevel 属性。可能的值包括 NoneSign 和EncryptAndSign

 

传输设置

设置XML 配置位置代码配置位置

连接缓冲区大小(字节)

transportProperties 元素的connectionBufferSize 属性。

DataCacheTransportProperties 类的 ConnectionBufferSize 属性。然后,这将分配给DataCacheFactoryConfiguration 类的 TransportProperties 属性。

最大缓冲区池大小(字节)

transportProperties 元素的maxBufferPoolSize 属性。

DataCacheTransportProperties 类的 MaxBufferPoolSize 属性。

最大缓冲区大小(字节)

transportProperties 元素的maxBufferSize 属性。

DataCacheTransportProperties 类的 MaxBufferSize 属性。

最大输出延迟(毫秒)

transportProperties 元素的maxOutputDelay 属性。

DataCacheTransportProperties 类的 MaxOutputDelay 属性。

通道初始化超时(毫秒)

transportProperties 元素的channelInitializationTimeout 属性。

DataCacheTransportProperties 类的 ChannelInitializationTimeout 属性。

接收超时(毫秒)

transportProperties 元素的receiveTimeout 属性。

DataCacheTransportProperties 类的 ReceiveTimeout 属性。

 

示例应用程序配置文件

代码
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   
<!--configSections must be the FIRST element -->
<configSections>
   
<!-- required to read the <dataCacheClient> element -->
   
<section name="dataCacheClient"
         type
="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
            Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0
            Culture
=neutral, PublicKeyToken=31bf3856ad364e35"
          allowLocation="true"
          allowDefinition
="Everywhere"/>
</configSections>

   
<dataCacheClient requestTimeout="15000" channelOpenTimeout="3000" maxConnectionsToServer="1">
      
<localCache isEnabled="true" sync="TimeoutBased" ttlValue="300" objectCount="10000"/>
      
<clientNotification pollInterval="300" maxQueueLength="10000"/>
      
<hosts>
         
<host name="CacheServer1" cachePort="22233"/>
         
<host name="CacheServer2" cachePort="22233"/>
      
</hosts>
      
<securityProperties mode="Transport" protectionLevel="EncryptAndSign" />
      
<transportProperties connectionBufferSize="131072" maxBufferPoolSize="268435456" 
                           maxBufferSize
="8388608" maxOutputDelay="2" channelInitializationTimeout="60000" 
                           receiveTimeout
="600000"/>
   
</dataCacheClient>
</configuration>
 
原文地址:https://www.cnblogs.com/linn/p/1932685.html