多DataCacheClients - 奇怪的配置行为 [英] Multiple DataCacheClients - Strange configuration behaviour

查看:288
本文介绍了多DataCacheClients - 奇怪的配置行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Azure的角色内缓存为我们的Web角色集群。

I am using Azure's In-Role caching for our web role cluster.

我需要使用单独的 dataCacheClients 所以有不同的,并明确设置传输特性配置( maxBufferPoolSize MAXBUFFERSIZE )。

I need to use separate dataCacheClients so to have different and explicitly set transport property configurations (maxBufferPoolSize and maxBufferSize).

问题是,每个 dataCacheClient 总是设置使用相同的 maxBufferPoolSize MAXBUFFERSIZE 值。他们都是从设定的值 dataCacheFactory 这是我第一次实例化

The problem is that each dataCacheClient is always set with the same maxBufferPoolSize and maxBufferSize values. They are all set to the values from the dataCacheFactory which I instantiate first.

<dataCacheClients>
  <dataCacheClient name="DataCache1">
    <autoDiscover isEnabled="true" identifier="MyRoleName" />
    <transportProperties maxBufferPoolSize="6400000" maxBufferSize="256" />
  </dataCacheClient>
  <dataCacheClient name="DataCache2">
    <autoDiscover isEnabled="true" identifier="MyRoleName" />
    <transportProperties maxBufferPoolSize="0" maxBufferSize="10485760" />
  </dataCacheClient>
  <dataCacheClient name="DataCache3">
    <autoDiscover isEnabled="true" identifier="MyRoleName" />
    <transportProperties maxBufferPoolSize="3276800" maxBufferSize="32768" />
  </dataCacheClient>
</dataCacheClients>

每个具体数据高速缓存对象从单独的 DataCacheFactory 实例实例化(包含静态的'经理'内)。我也试图恢复到编程创建缓存的客户端,但无济于事。

Each concrete DataCache object is instantiated from separate DataCacheFactory instances (contained inside static 'managers'). I have also tried reverting to creating the cache clients programmatically, but to no avail.

所以,这里是一个异常被抛出,由于MAXBUFFERSIZE处于256太小了。

So, here is an exception being thrown due to MaxBufferSize being too small at 256.

在调试的工厂,你可以清楚地看到,MAXBUFFERSIZE不是256:

When debugging the factory, you can clearly see that the MaxBufferSize is not 256:

我开始拉我的头发,所以我想出了两个想法:

I am starting to pull my hair out, so I've come up with the two ideas:

我怀疑是在 StartPort DiscoveryPort 中的每个数据客户 AutoDiscoveryProperties 是在所有相同的(22233为 StartPort 和24233为 DiscoveryPort ),这使我相信他们可以从同一个工厂拉动(因此使用相同的设置)。

My suspicion is that the StartPort and DiscoveryPort in each data clients' AutoDiscoveryProperties are the same across all (22233 as StartPort and 24233 as DiscoveryPort), which makes me believe that they could be pulling from the same factory (and thus using the same settings).

此外, DataCacheServerEndpoint 为每一个客户也是一样,在20004.也许他们需要的是不同的?

In addition, the DataCacheServerEndpoint for each client is also the same, at 20004. Perhaps they need to be different?

我使用Microsoft.WindowsAzure.Caching 2.4.0.0和Azure的SDK 2.4。

I am using Microsoft.WindowsAzure.Caching 2.4.0.0 and Azure SDK 2.4.

谁能帮我指出了正确的方向?

推荐答案

看来你的问题不是客户端站点,但服务器端。确保您在MAXBUFFERSIZE你的服务器是正确的大小,示例配置MSDN

It seems your problem is not client site, but server side. Make sure your maxBufferSize at your server is the right size, sample configuration 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>

Azure的主机配置

这篇关于多DataCacheClients - 奇怪的配置行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆