From official documentation:
Since MUX uses a single connection per node for Memcached (K/V) operations, many of the connection pool settings no longer apply (for example MinSize and MaxSize).
Based on our observations connection pool settings (Min/MaxSize) are still used even when .NET SDK uses MUX IO which should not be the case because multiplexing IO should use exactly one socket per each instance (as per spec).
So we’re wodering if that discepancy is because of buggy .NET SDK or is it supposed to perform multiplexing over multiple sockets? In that case, I suppose, spec needs to be updated?
Here is a test we used to process a lot of simultaneous read requests:
UnitTestSetUp.CouchbaseClient.Set<object>(key, document);
var test = new List<Task>();
for (var i = 0; i < 100000; i++)
test.Add(UnitTestSetUp.CouchbaseClient.GetAsync<object>(key));
await Task.WhenAll(test);
Configuration when using MUX IO with pool configuration:
// The maximum and minimum number of TCP connection to create/use with pooled IO service.
bucketConfiguration.PoolConfiguration.MaxSize = 50;
bucketConfiguration.PoolConfiguration.MinSize = 5;
this.clusterConfiguration.ConnectionPoolCreator = ConnectionPoolFactory.GetFactory<ConnectionPool<MultiplexingConnection>>();
this.clusterConfiguration.IOServiceCreator = IOServiceFactory.GetFactory<MultiplexingIOService>();
Configuration when using MUX IO w/o pool configuration:
this.clusterConfiguration.ConnectionPoolCreator = ConnectionPoolFactory.GetFactory<ConnectionPool<MultiplexingConnection>>();
this.clusterConfiguration.IOServiceCreator = IOServiceFactory.GetFactory<MultiplexingIOService>();
So, if we do set min/max size on pool configuration and use MUX service number and run test with multiple read requests on single instance, number of connections increases by more that 1 (unexpected). However if we don’t set min/max size for pool config, number of connections during the test is exacly 1 (as expected).
We’re using .NET SDK 2.5.0.
– Simon