Hello Mike, first thanks for your interest.
- Please can you share your code that you are using that is resulting in high latency
Our code block like as shown below:
public IEnumerable<VariantStockInfo> GetVariantInfoList(IEnumerable<string> ids)
{
IDictionary<string, IOperationResult<StockInfo>> operationResults = null;
operationResults = _bucket.Get<StockInfo>(ids.ToList(), new ParallelOptions
{
MaxDegreeOfParallelism = 2 //can change
});
//...
}
}
- Please can you also share the client configurations you’ve tried
This one our current configuration the best for us:
ClientConfiguration clientConfiguration = new ClientConfiguration
{
Servers = GetCouchBaseUris(),
ConnectionPoolCreator = ConnectionPoolFactory.GetFactory<ConnectionPool<MultiplexingConnection>>(),
IOServiceCreator = IOServiceFactory.GetFactory<MultiplexingIOService>()
};
Also, we tried this based on some articles:
ClientConfiguration clientConfiguration = new ClientConfiguration
{
Servers = GetCouchBaseUris(),
Serializer = () => new CustomJilSerializer(),
EnableConfigHeartBeat = true,
PoolConfiguration = new PoolConfiguration
{
MaxSize = 35,
MinSize = 5
},
BucketConfigs = new Dictionary<string, BucketConfiguration>
{
{variantStockBucket,new BucketConfiguration
{
PoolConfiguration = new PoolConfiguration
{
MinSize = 35,
MaxSize = 5
},
BucketName = variantStockBucket
} }
}
};
Are you working in a sync or async scenario
We tried both of them with the “GetDocumentsAsync<>” and “Get<>” methods. The “GetDocumentsAsync<>” method looks like more efficient instead of “Get<>” method for the multiple get operation.
- How do you work out the keys you want to retrieve
I don’t understand this question.
Why is the Parallel.ForEach unacceptable?
Yes, you right Parallel is the good option to most use cases. But, it depends based on the environments. It seems like multiplexer can’t manage the TCP connections, because it creates a lot of connections much more then the key count i use, parallel calls may be more feasible with 100-200 keys but when I need work with more keys 1000-5000, we begin facing connections problems.
Regards