How to increase the number of the worker thread (default 4) to 8?


I’m using couchbase in a 8 logic-cpu server, and want to increase the worker thread number from default 4 to 8, and to more balance the workloads. But I don’t know how to increase it. Please help on that!



You can use the REST API to modify your bucket, for example:

curl -v -X POST -u Administrator:welcome1 -d name=beer-sample -d flushEnabled=0 -d replicaNumber=1 -d authType=none -d ramQuotaMB=200 -d proxyPort=11212 -d threadsNumber=8 http://localhost:8091/pools/default/buckets/beer-sample

The parameter to use is: threadsNumber




Thanks Tug.
I tried this, but “threadsNumber” is to change the number of concurrent readers and writers for the data bucket. and what I want to change is the # of memcached worker threads (default is 4). Do you know is there a method I can change this?



Hey Vincent, you can use this to change the “front-end” worker threads from 4 to 8:

curl --data “[ns_config:update_key({node, N, memcached}, fun (PList) -> lists:keystore(verbosity, 1, PList, {verbosity, ‘-t 8’}) end) || N <- ns_node_disco:nodes_wanted()].” -u Administrator: http://:8091/diag/eval

You only need to run this once against a cluster, but it will restart all the memcached processes at once.

I realize it’s a little cumbersome, but this is typically not something we need to do unless the processes are being asked to handle more than 100k ops/sec.