代码之家  ›  专栏  ›  技术社区  ›  irperez

是否可以调整AppFabric缓存服务器以存储较大的对象?

  •  7
  • irperez  · 技术社区  · 15 年前

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

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

    我肯定这不是网络问题。我可以在这个特定的对象之前添加一些对象到缓存中。仔细看,这个对象比其他添加到缓存中的对象大一点。

    如何调整AppFabric缓存上的MaxBufferSize?

    2 回复  |  直到 13 年前
        1
  •  8
  •   Nix    15 年前

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

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

    编辑:

    来自的DataCacheClient部分的示例 MSDN

    <?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>
    
        2
  •  9
  •   Manuel    13 年前

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

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

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

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

    Export-CacheClusterConfig -File [yourfilepath] 
    

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

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

    不过,不建议将大型文件存储在AppFabric缓存中。