Performance of Java SDK 2.x is 10x slower than SDK 1.4


#1

I started off my research using SDK 2.x. My test is against a cluster of 2 powerful nodes (32 cores with SSD)
Network speed between cluster and client is 10Gbps.
My scenario requires a single process to insert documents to Couchbase.
Writing a simple Json as shown in source code below, I got not more 4000 sets/secs.
Out of curiosity I tested the same program using SDK 1.4, and I got more than 30000 sets/secs.
Using cbworkloadgen could easily reach 20000 sets/secs too.

My question is that is there any major change of performance characteristic in SDK 2.x? For example, it is only better than 1.x in terms of concurrent multiple connections?

//SDK 2.1.3
String content = “{ “glossary”: { “title”: “example glossary”, “GlossDiv”: { “title”: “S”, “GlossList”: { “GlossEntry”: { “ID”: “SGML”, “SortAs”: “SGML”, “GlossTerm”: “Standard Generalized Markup Language”, “Acronym”: “SGML”, “Abbrev”: “ISO 8879:1986”, “GlossDef”: { “para”: “A meta-markup language, used to create markup languages such as DocBook.”, “GlossSeeAlso”: [“GML”, “XML”] }, “GlossSee”: “markup” } } } } }”;
for(int i=0; i<200000000; i++){
StringDocument sd = StringDocument.create(“id”+i, content);
bucket.insert(sd);
}

//SDK 1.4
String content = “{ “glossary”: { “title”: “example glossary”, “GlossDiv”: { “title”: “S”, “GlossList”: { “GlossEntry”: { “ID”: “SGML”, “SortAs”: “SGML”, “GlossTerm”: “Standard Generalized Markup Language”, “Acronym”: “SGML”, “Abbrev”: “ISO 8879:1986”, “GlossDef”: { “para”: “A meta-markup language, used to create markup languages such as DocBook.”, “GlossSeeAlso”: [“GML”, “XML”] }, “GlossSee”: “markup” } } } } }”;
for(int i=0; i<200000000; i++){
client.set(“id”+i, content);
}


#2

me too.

You compute the usage time including json processing.


#3

With SDK 1.4, I included Json computation using Jackson to generate the same Json string. The speed never decrease.
I tested for 4 concurrent processes, the speed grows linearly.


#4

we’ll have to dig deeper at your problem, because this kind of performance with the kind of hardware configuration you have indeed feels very low.

just a side note though, you are using StringDocument which will store data flagged as String in couchbase, where it should be identified as JSON (so that it can be indexed in views for instance). Prefer using RawJsonDocument for storing a String representation of a JSON object.