【问题标题】:Is it possible to adjust AppFabric Cache server to store larger objects?是否可以调整 AppFabric 缓存服务器以存储更大的对象?
【发布时间】:2011-03-27 20:29:51
【问题描述】:

当我假设一个更大的对象图被添加到缓存时,AppFabric 缓存服务器出现错误。

ErrorCode :SubStatus:连接已终止,可能是由于服务器或网络问题或序列化对象大小大于服务器上的 MaxBufferSize。请求结果未知。

我确定这不是网络问题。我能够在这个特定对象之前添加一堆对象进行缓存。仔细一看,这个对象比其他添加到缓存中的对象要大一些。

如何调整 AppFabric Cache 上的 MaxBufferSize?

【问题讨论】:

    标签: .net caching .net-4.0 appfabric


    【解决方案1】:

    您还需要增加服务器端的缓冲区大小:

    如果您使用 XML 配置,请添加以下内容:

    <advancedProperties>      
        <transportProperties maxBufferSize="8388608" />
    </advancedProperties> 
    

    如果使用SQL配置,需要导出到文件:

    Export-CacheClusterConfig -File [yourfilepath] 
    

    更改上面列出的文件,然后再次导入:

    Stop-CacheCluster 
    Import-CacheClusterConfig -File [yourfilepath]
    Start-CacheCluster
    

    但不建议将大文件存储在 AppFabric 缓存中。

    【讨论】:

      【解决方案2】:

      客户端它是 DataCacheClient 配置部分中传输元素上的 maxBufferSize

         <transportProperties  ..whatever else you have..  maxBufferSize="8388608"  />
      

      编辑:

      来自MSDN 的 DataCacheClient 部分示例

      <?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>
      

      【讨论】:

      • 服务器端不是也需要做点什么吗?
      • 您能否提供数据缓存部分的示例 XML 配置?
      • 服务器需要相同的设置,在其配置的 advancedProperties 元素下。
      • 除此之外,这里 (social.msdn.microsoft.com/Forums/en-US/velocity/thread/…) 对缓冲区大小和接收超时所做的调整解决了我的问题。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-28
      相关资源
      最近更新 更多