是否可以调整AppFabric Cache服务器来存储更大的对象?

irp*_*rez 7 .net caching .net-4.0 appfabric

当我假设更大的对象图被添加到缓存时,我收到AppFabric缓存服务器的错误.

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

我确信它不是网络问题.我能够在这个特定的对象之前添加一堆对象进行缓存.调查一下,该对象比添加到缓存中的其他对象要大一些.

如何在AppFabric Cache上调整MaxBufferSize?

Man*_*uel 9

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

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

<advancedProperties>      
    <transportProperties maxBufferSize="8388608" />
</advancedProperties> 
Run Code Online (Sandbox Code Playgroud)

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

Export-CacheClusterConfig -File [yourfilepath] 
Run Code Online (Sandbox Code Playgroud)

更改上面列出的文件,然后重新导入:

Stop-CacheCluster 
Import-CacheClusterConfig -File [yourfilepath]
Start-CacheCluster
Run Code Online (Sandbox Code Playgroud)

但是,不建议在AppFabric Cache中存储大文件.


Nix*_*Nix 8

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

   <transportProperties  ..whatever else you have..  maxBufferSize="8388608"  />
Run Code Online (Sandbox Code Playgroud)

编辑:

来自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>
Run Code Online (Sandbox Code Playgroud)

  • 服务器端是否还有必须完成的事情? (2认同)