2010-08-10 70 views
7

当我假定一个较大的对象图被添加到缓存中时,出现AppFabric Cache Server错误。是否可以调整AppFabric Cache服务器以存储较大的对象?

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

我知道肯定它不是一个网络问题。在这个特定的之前,我能够添加一堆对象来缓存。看着它,该对象比添加到缓存中的其他对象稍大一些。

我怎样才能调整对AppFabric的缓存的MAXBUFFERSIZE?

回答

8

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

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

编辑:

如果您使用XML配置:

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

是不是有东西,必须要在服务器端完成的呢? – irperez 2010-08-10 14:33:33

+0

您能否提供DataCache部分的示例XML配置? – irperez 2010-08-10 14:33:56

+0

服务器需要在其配置的advancedProperties元素下进行相同的设置。 – andrewbadera 2011-05-22 18:17:55

9

你需要增加缓冲区大小在服务器端,以及在DataCacheClient部分的示例添加以下内容:

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

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

Export-CacheClusterConfig -File [yourfilepath] 

更改文件上面列出不是再次导入:

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

尽管如此,它不建议存放AppFabric Cache中的大文件。

相关问题