How to increase couchbase performance


#1

I am doing POC on document data store so for that I have selected MongoDB and CouchBase for evaluation.

Environment Detail is as below

Machine : Centos 6.7, 2 core cpu, CPU MHz: 2494.078, RAM : 7 GB (6 GB Free)

MongoBD db version v3.2.0 with default configuration

CouchBase Version: 4.1.0-5005 Enterprise Edition (Cluster RAM: 3GB, Bucket RAM: 1GB)

Document Size : 326 B

Following is the result of POC

> +--------------+---------------------------------------------+--------------+--------------+--------------+--------------+--------------+-------------+-------------+
> |  Operation   | insert (in 10 batch each bacth is of 100K ) | select query | select query | select query | select query | select query | range query | range query |
> +--------------+---------------------------------------------+--------------+--------------+--------------+--------------+--------------+-------------+-------------+
> | Record Count | 1000K                                       | 0            | 100          | 33k          | 140k         | 334k         | 114k        | 460k        |
> | Mongo        | 99 sec                                      | 568ms        | 792ms        | 1500ms       | 3800ms       | 7800ms       | -           | 15387ms     |
> | CouchBase    | 370 sec                                     | 8ms          | 250ms        | 6700ms       | 28000ms      | 69000ms      | 28644ms     | -           |
> +--------------+---------------------------------------------+--------------+--------------+--------------+--------------+--------------+-------------+-------------+

Client: I have used JAVA sdk and spring data.

There is big diffrence in performance of couchbase and mongodb on single node. Is there any configuration parameter to increase performnace of couchbase?


#2

Can you please share the type of queries you execute on both mongo and couchbase as well as the indexes that are created on both?


#3

below is sample document

{
“objectDescription”: “f5878623-59ba-4e3b-bb34-a6bb8fb98082”,
"_class": “com.pepperfry.migrationutil.entity.PAdminLog”,
“objectId”: 2362,
“description”: “⺑ᄊ៘ܺ퇲㒔쮛柜껱”,
“actionType”: “save”,
“date”: 1404152017846,
“user”: “Althea Drolet”,
“objectType”: “Position”,
“ip”: “181.178.215.232”
}

so I have run query on every field except “description” field in both mongo and couchbase.
I have used views in case of couchbase and below is example

function (doc, meta) {
if(doc._class == “com.pepperfry.migrationutil.entity.PAdminLog” && doc.actionType) {
emit(doc.actionType, null);
}
}

below is snippet I have used to query couchbase

public List findByActionType(String action)
{
Query query = new Query();
query.setKey(ComplexKey.of(action));
return adminLoggerRepository.findByActionType(query);
}


#4

@vipull_tiwari thanks for sharing! Can you also share the mongo equivalent?