I am using Azure's In-Role caching for our web role cluster.
I need to use separate dataCacheClients
so to have different and explicitly set transport property configurations (maxBufferPoolSize
and maxBufferSize
).
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>
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.
So, here is an exception being thrown due to MaxBufferSize being too small at 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:
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).
In addition, the DataCacheServerEndpoint
for each client is also the same, at 20004. Perhaps they need to be different?
I am using Microsoft.WindowsAzure.Caching 2.4.0.0 and Azure SDK 2.4.
Can anyone help point me in the right direction?
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:
Azure host configuration
Try using the following snippet:
Alternatively you can configure it programmatically:
Edit1: I created two different client using two different factories and I can see both of them having different max buffer size.