0

우리 웹 역할 클러스터에 Azure의 In-Role 캐싱을 사용하고 있습니다.여러 DataCacheClient - 이상한 구성 동작

별도로 dataCacheClients을 사용해야 전송 속성 구성 (maxBufferPoolSizemaxBufferSize)을 다르게 명시 적으로 설정해야합니다.

dataCacheClient은 항상 maxBufferPoolSizemaxBufferSize 값으로 설정됩니다. 그들은 모두 내가 처음 인스턴스화하는 dataCacheFactory의 값으로 설정됩니다.

<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> 

각 콘크리트 DataCache 객체

별도 DataCacheFactory 인스턴스로부터 인스턴스화 된 (정적 '관리자'안에 포함). 나는 또한 프로그래밍 방식으로 캐시 클라이언트를 생성하려고했지만 아무 소용이 없다.

:

그래서, 여기에 공장을 디버깅 할 때 예외가 256

DataCacheException thrown

로 인해 해당 MaxBufferSize가 너무 작은 것에 던져지는 것입니다, 당신은 해당 MaxBufferSize 256 아니라는 것을 분명히 볼 수 있습니다 MaxBufferSize debugging

내 머리를 꺼내하기 시작하고, 그래서 두 개의 아이디어를 왔어요 :

,

내 데이터 클라이언트의 AutoDiscoveryProperties에있는 StartPortDiscoveryPort이 모두 (22233을 StartPort 및 24233을 DiscoveryPort으로 사용하여) 동일하므로이 둘이 같은 공장에서 가져올 수 있다고 생각합니다. 설정).

또한 각 클라이언트의 DataCacheServerEndpoint도 20004 년과 동일합니다. 서로 다를 필요가 있을까요?

Microsoft.WindowsAzure.Caching 2.4.0.0 및 Azure SDK 2.4를 사용하고 있습니다.

누구든지 올바른 방향으로 나를 가리킬 수 있습니까?

답변

-1

다음 코드를 사용해보십시오 : 나는 두 개의 다른 공장을 사용하여 두 개의 서로 다른 클라이언트를 생성 나는 그들 모두를 볼 수 있습니다

 // This will create an instance of DataCacheFactoryConfiguration from default datacache client in config. 
     DataCacheFactoryConfiguration dcfc = new DataCacheFactoryConfiguration(); 
     //You can then set the buffer size as you wish and create DataCacheFactory and DataCache after that. 
     dcfc.TransportProperties.MaxBufferSize = size; 
     DataCacheFactory dcf = new DataCacheFactory(dcfc); 
     DataCache dc = dcf.GetDefaultCache(); 

EDIT1을 :

 // DataCacheFactoryConfiguration encapsulates the datacache client section of the config. 
     DataCacheFactoryConfiguration dcfc1 = new DataCacheFactoryConfiguration("DataCache1"); 
     DataCacheFactory dcf1 = new DataCacheFactory(dcfc1); 
     DataCache dc1 = dcf1.GetDefaultCache(); 

은 다른 방법은 프로그래밍 방식으로 구성 할 수 있습니다 최대 버퍼 크기가 다릅니다.

 DataCacheFactoryConfiguration dcfc = new DataCacheFactoryConfiguration(); 
     dcfc.TransportProperties.MaxBufferSize = 8388608; 
     DataCacheFactory dcf = new DataCacheFactory(dcfc); 
     DataCache dc = dcf.GetDefaultCache(); 

     DataCacheFactoryConfiguration dcfc1 = new DataCacheFactoryConfiguration(); 
     dcfc1.TransportProperties.MaxBufferSize = 8388; 
     DataCacheFactory dcf1 = new DataCacheFactory(dcfc1); 
     DataCache dc1 = dcf1.GetDefaultCache(); 
+0

을 이미이 일을하고있다. 같은 문제. – davenewza

+0

startPort, discoveryPort 및 dataCacheServerEndpoint는 모두 서버 속성 (즉, 클라이언트가 서버에 연결해야하는 곳)입니다. 두 개의 서로 다른 팩토리를 사용하여 두 개의 다른 클라이언트를 만들려고했는데 둘 다 다른 최대 버퍼 크기를 볼 수 있습니다. –

0

귀하의 문제는 클라이언트 사이트가 아니라 서버 측으로 보입니다. sample configuration msdn, 반드시 서버에서 사용자가 MaxBufferSize는 적당한 크기인지 확인하십시오 :

<?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 host configuration

+0

Azure In-Role 캐싱에 대해 어떻게 확인하나요? – davenewza

+0

http://msdn.microsoft.com/en-us/library/ee790928.aspx – Peter

+0

나는 그것이 Azure를위한 것인지 아직 확실하지 않다. 역할 인스턴스에서 "DistributedCacheService.exe.config"파일을 검색했지만 아무것도 찾을 수 없습니다. – davenewza