Couchbase times out after few seconds

倖福魔咒の 提交于 2019-12-10 20:08:09

问题


I have about 100-200k small documents which contain base64 encoded images (quite small images). I am trying to insert all these documents to the Couchbase and I keep getting this error after first 28k documents (about 185 Mb total size)

[Error: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout] code: 23

Here is screenshot of Couchbase settings (I see only one strange thing here — free space is totally wrong, actually it is about 300GB of free space on my disk)

My code is pretty simple and looks like this

 _.forOwn(data, function (data) {
    var item_id = "item::" + uid().toString();

    db.set(item_id, data, function(err, result) {
        if (err) {
            console.log('cb error', err);
        }
        else {
            console.log('cb success', result);
        }
    });
 });

I tried to alter documents and make them smaller or larger — it doesn't matter, after 28k database stops responding. It saves 28k in few seconds and then throws timeout. What should I do to fix this issue?


upd

I installed Couchbase 2.5 Enterprise and now free space is shown correctly. However I am still not able to pass through 28k limit. I am running Mac OS X 10.9.2. Maybe I should try to use Python or Java SDK for example?


Tried to install Couchbase on Ubuntu 14.04, now get the same error after 46k docs.

Here is screenshot of graphs (two peaks shows my two attempts to import files into Couchbase)


回答1:


Switch to couchbase protocol and increase timeout.

Here's an example of connection to local couchbase from node.js:

callback = function(err)
{
  if (err)
    throw err;
}

var cluster = cluster = new couchbase.Cluster("couchbase://localhost/default");
var bucket = cluster.openBucket("default", callback);
bucket.operationTimeout = 60 * 1000; // 60 seconds operation timeout (LCB_CNTL_OP_TIMEOUT)

Please note that "localhost:8091" - is http protocol only.




回答2:


This issue was solved when I switched from nodejs sdk to python sdk.



来源:https://stackoverflow.com/questions/23772481/couchbase-times-out-after-few-seconds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!