I am currently testing the .NET SDK 2.3.6 and am testing MUX IO. The development environment is running Couchbase 4.1.0-5005 Enterprise Edition (build-5005)
Everything seemed OK with some basic testing so I thought I’d see how MUX compares with the traditional pooled connections if I pounded it a bit. I found that MUX performed significantly slower. Below are my test results and the code I used to perform the test.
I am curious if there are any thoughts on why the performance with MUX would be significantly worse than traditional pooling.
Without MUX, the test completed in 00:00:07.1332256
With MUX, the test completed in 00:02:08.5374719
First, here is a simple loop I used to process a lot of simultaneous requests:
var result = Parallel.For(0, 100000, ctr =>
{
var bucket = GlobalObjectManager.CouchbaseManager.Bucket;
var doc = bucket.GetDocument<dynamic>("sampledoc");
});
Here’s my configuration when using MUX:
public static class CouchbaseManager
{
private readonly static Cluster _instance;
private readonly static IBucket _bucket;
static CouchbaseManager()
{
var config = new ClientConfiguration();
config.Servers = new List<Uri>
{
new Uri("http://localhost:8091/pools")
};
config.UseSsl = false;
config.ConnectionPoolCreator = ConnectionPoolFactory.GetFactory<ConnectionPool<MultiplexingConnection>>();
config.IOServiceCreator = IOServiceFactory.GetFactory<MultiplexingIOService>();
_instance = new Cluster(config);
_bucket = _instance.OpenBucket("bucket_name", "bucket_password");
}
public static Cluster Instance { get { return _instance; } }
public static IBucket Bucket
{
get
{
return _bucket;
}
}
}
And here’s my configuration when using traditional pooling:
public static class CouchbaseManager
{
private readonly static Cluster _instance;
private readonly static IBucket _bucket;
static CouchbaseManager()
{
var config = new ClientConfiguration();
config.Servers = new List<Uri>
{
new Uri("http://localhost:8091/pools")
};
config.UseSsl = false;
var poolConfiguration = new PoolConfiguration();
poolConfiguration.MinSize = 5;
poolConfiguration.MaxSize = 50;
config.PoolConfiguration = poolConfiguration;
_instance = new Cluster(config);
_bucket = _instance.OpenBucket("bucket_name", "bucket_password");
}
public static Cluster Instance { get { return _instance; } }
public static IBucket Bucket
{
get
{
return _bucket;
}
}
}