You are viewing the documentation for a prerelease version.

View Latest

Setting Thread Allocations

The numbers of reader and writer threads for a node is configurable.

HTTP method and URI

POST /pools/default/settings/memcached/global

Description

Couchbase Server allows the number of threads allocated per node for reading and writing to be configured by the administrator. The maximum thread-allocation for each is 64, the minimum 4.

A high thread-allocation may improve performance on systems whose hardware-resources are commensurately supportive (for example, where the number of CPU cores is high). In particular, a high number of writer threads on such systems may significantly optimize the performance of durable writes: see Durability, for information.

Note, however, that a high thread-allocation might impair some aspects of performance on less appropriately resourced nodes. Consequently, changes to the default thread-allocation should not be made to production systems without prior testing.

Curl Syntax

curl -X POST -d hostname=<host>:<port>
  -d num_reader_threads=<int>
  -d num_writer_threads=<int>
  -d password=<password>
  -u <administrator>:<password>
  http://<host>:<port>/pools/default/settings/memcached/global

The value of int must be an integer between 4 and 64, inclusive.

Responses

Success returns an object whose values confirm the settings that have been made.

Examples

To set the number of reader and writer threads for Couchbase Server, use the POST /pools/default/settings/memcached/global http method and endpoint as follows:

curl -v -X POST -u Administrator:password \
http://10.143.192.101:8091/pools/default/settings/memcached/global \
-d num_reader_threads=12 \
-d num_writer_threads=8

This sets the number of reader threads to 12, and the number of writer threads to 8. If successful, the call returns an object whose values confirm the settings that have been made:

{"num_reader_threads":12,"num_writer_threads":8}

See Also

See Durability, for information on durable writes. See See Threading for an overview of reader and writer threads.