Dot-Net
是否可以調整 AppFabric 記憶體伺服器以儲存更大的對象?
當我假設一個更大的對像圖被添加到記憶體中時,我遇到了 AppFabric 記憶體伺服器錯誤。
ErrorCode :SubStatus: 連接已終止,可能是由於伺服器或網路問題或序列化對像大小大於伺服器上的 MaxBufferSize。請求的結果未知。
我確定這不是網路問題。我能夠在這個特定對象之前添加一堆對象進行記憶體。仔細研究一下,這個對像比其他添加到記憶體中的對像要大一些。
如何調整 AppFabric 記憶體上的 MaxBufferSize?
客戶端它是 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>
您還需要增加伺服器端的緩衝區大小:
如果您使用 XML 配置,請添加以下內容:
<advancedProperties> <transportProperties maxBufferSize="8388608" /> </advancedProperties>如果使用 SQL 配置,則需要將其導出到文件:
Export-CacheClusterConfig -File [yourfilepath]更改上面列出的文件,然後再次導入:
Stop-CacheCluster Import-CacheClusterConfig -File [yourfilepath] Start-CacheCluster不過,不建議將大文件儲存在 AppFabric 記憶體中。