前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Windows Server AppFabric Caching支持大数据量的配置

Windows Server AppFabric Caching支持大数据量的配置

作者头像
张善友
发布2018-01-22 11:12:27
5680
发布2018-01-22 11:12:27
举报
文章被收录于专栏:张善友的专栏张善友的专栏

Memcache支持的数据量大小为1M,最新版本可以通过配置调整突破1M(参看http://www.cnblogs.com/shanyou/archive/2010/02/01/1661271.html),AppFabric Caching也支持大数据量的缓存。当你看到这样的错误的时候就需要调整参数了。

Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRCA0016>:SubStatus<ES0001>:The connection was terminated, possibly due to server or network problems or serialized Object size is greater than MaxBufferSize on server. Result of the request is unknown.

解決方法,必须同时在 服务端及 客户端增加 MaxBufferSize 的配置。

  • 首先是 服务端
Export Cluster Config

Export-CacheClusterConfig -File c:\temp\appFabriccluster.config 将Cluster 的配置导出到一个xml config 文件。这里我取名叫做 appFabriccluster.config

增加 transportProperties 的配置,按照 Application Configuration Settings 的建议,在上一步驟的appFabriccluster.config 增加下面的配置。
导入并应用配置

在导入配置前,必须先停止 Cluster。导入配置完成后,再启动Cluster。

Stop-CacheCluster Import-CacheClusterConfig -File c:\temp\appFabriccluster.config Start-CacheCluster

  • 再來是 客户端

在 Client config 加入 transportProperties 配置

代码语言:js
复制
   1: <?xml version="1.0" encoding="utf-8" ?>
   2: <configuration>
   3:    <!--configSections must be the FIRST element -->
   4: <configSections>
   5:    <!-- required to read the <dataCacheClient> element -->
   6:    <section name="dataCacheClient"
   7:          type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
   8:             Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, 
   9:             Culture=neutral, PublicKeyToken=31bf3856ad364e35"
  10:           allowLocation="true"
  11:           allowDefinition="Everywhere"/>
  12: </configSections>
  13:  
  14:    <dataCacheClient requestTimeout="15000" channelOpenTimeout="3000" maxConnectionsToServer="1">
  15:       <localCache isEnabled="true" sync="TimeoutBased" ttlValue="300" objectCount="10000"/>
  16:       <clientNotification pollInterval="300" maxQueueLength="10000"/>
  17:       <hosts>
  18:          <host name="CacheServer1" cachePort="22233"/>
  19:          <host name="CacheServer2" cachePort="22233"/>
  20:       </hosts>
  21:       <securityProperties mode="Transport" protectionLevel="EncryptAndSign" />
  22:       <transportProperties connectionBufferSize="131072" maxBufferPoolSize="268435456" 
  23:                            maxBufferSize="8388608" maxOutputDelay="2" channelInitializationTimeout="60000" 
  24:                            receiveTimeout="600000"/>
  25:    </dataCacheClient>
  26: </configuration>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2010-08-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Export Cluster Config
    • 增加 transportProperties 的配置,按照 Application Configuration Settings 的建议,在上一步驟的appFabriccluster.config 增加下面的配置。
      • 导入并应用配置
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档