7

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

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

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

如何调整 AppFabric 缓存上的 MaxBufferSize?

4

2 回答 2

9

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

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

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

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

Export-CacheClusterConfig -File [yourfilepath] 

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

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

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

于 2011-10-03T12:48:29.207 回答
8

客户端它是 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>
于 2010-08-10T14:04:01.907 回答