I’ve written a really awful (bad code, I’m not proud, but it was quick) client that I’m using to compare performance of CouchbaseNetClient v1.3.12 and v2.1.1.
We have a 2 node cluster for testing.
The v1-based client is working fine (both nodes in cluster), but the v2-based client is failing, consistently, for requests to the 2nd node, operations (SET / UPSERT and DELETE / REMOVE) with certain keys. I get back “NodeUnavailable”. I have verified where the documents would be written basked on responses of cbc-hash.
During the setup process, I do notice:
A first chance exception of type ‘System.OutOfMemoryException’ occurred in Couchbase.NetClient.dll
A first chance exception of type ‘Couchbase.IO.ConnectionUnavailableException’ occurred in Couchbase.NetClient.dll
Here’s the blocks of code, I can package up these projects if need be.
v1.3.12:
public void runThread() { var stopWatch = new Stopwatch(); stopWatch.Start();
for (int i = 0; i < _iterations; i++) { stopWatch.Restart(); var item = "test-" + _threadId + "-" + i; bool result = _form._cbClient.Store(StoreMode.Set, item, "{'data':'value'}"); Console.Out.WriteLine(String.Format("SET '{0}' Got Response: {1}", item, result.ToString())); _form.iterationCompleted(stopWatch.ElapsedMilliseconds, result); } stopWatch.Stop();
// attempt to cleanup if selected if (_cleanup) { for (int i = 0; i < _iterations; i++) { var item = "test-" + _threadId + "-" + i; var result = _form._cbClient.Remove(item); Console.Out.WriteLine(String.Format("REMOVE '{0}' Got Response: {1}", item, result.ToString())); } }
_form.finishedThread(this); } }
v2.1.1:
public void runThread() { var stopWatch = new Stopwatch(); stopWatch.Start();
for (int i = 0; i < _iterations; i++) { stopWatch.Restart(); var bucket = ClusterHelper.GetBucket(_bucketName); var item = "test-" + _threadId + "-" + i; IOperationResult result; result = bucket.Upsert(item, "{'data':'value'}"); Console.Out.WriteLine(String.Format("UPSERT '{0}' Got Response: {1} with CAS: {2}", item, result.Status.ToString(), result.Cas.ToString())); _form.iterationCompleted(stopWatch.ElapsedMilliseconds, result.Success); } stopWatch.Stop();
// attempt to cleanup if selected if (_cleanup) { for (int i = 0; i < _iterations; i++) { var bucket = ClusterHelper.GetBucket(_bucketName); var item = "test-" + _threadId + "-" + i; var result = bucket.Remove(item); Console.Out.WriteLine(String.Format("DELETE '{0}' Got Response: {1} with CAS: {2}", item, result.Status.ToString(), result.Cas.ToString())); } }
_form.finishedThread(this); }
Any ideas?
-H