XDCR Advanced Settings

XDCR performance can be fine-tuned.

Table of XDCR Advanced Settings

The performance of XDCR can be fine-tuned, by means of configuration-settings, specified when a replication is defined. These are explained in the table below.

Option Description

XDCR Compression Type

Specifies whether documents are to be compressed for XDCR, and if so, what compression type is to be used. A value of None specifies that data compression is not used during replication. A value of Snappy specifies that the open-source Snappy library is used to provide data compression during replication. The default value, Auto, specifies that the latest Couchbase-provided form of data compression is used. (If compression is indeed required, specifying Auto is recommended; since this means use of the best available compression technology.)

XDCR Source Nozzles per Node

Determines the number of XDCR source nozzles per node. This value must be less than or equal to that specified for XDCR Target Nozzles per Node, to ensure that all mutations transmitted from the source can be handled by the target.

A small value of 2 or 4 is often sufficient. The default is 2. The value-range is 1-100.

XDCR Target Nozzles per Node

Determines the number of XDCR target nozzles (concurrent XDCR worker threads) per node. A high value can be used if the target nodes have high processing power. The default is 2. The value-range is 1-100. This value must be greater than or equal to that specified for XDCR Target Nozzles per Node, to ensure that all mutations transmitted from the source can be handled by the target.

XDCR Checkpoint Interval

Specifies the duraction of the Checkpoint Interval. During this interval (which does not affect the persistence of data), XDCR computes and persists checkpoint documents, which contain the high sequence number for each vBucket successfully replicated to the target cluster.

If the replication is restarted by user, or recovers from an error, the checkpoint documents can be used to determine the starting point of the replication, to avoid unnecessary work. The shorter the interval, the more accurate the checkpoint documents, and the smaller the amount of work needed at replication restart. Note that the computation and persistence of checkpoint documents use considerable system resources and may impact XDCR performance.

XDCR Batch Count

Specifies the document batching count, in the range of 500 to 10000. The default is 500.

In general, increasing this value by 2 or 3 times improves XDCR transmission-rates, since larger batches of data are sent in the specified interval. Overall replication performance is correspondingly improved, provided that disk-persistence can be adequately managed on the target cluster. (Note that the volume or reads and writes may be significantly greater on clusters that function both as sources and targets for bidirectional replication.)

XDCR Batch Size (kilobytes)

Specifies the document batching size, in the range of 10 to 100000 (kilobytes). The default is 2048.

In general, increasing this value by 2 or 3 times improves XDCR transmission-rates, since larger batches of data are sent in the specified interval. Overall replication performance is correspondingly improved, provided that disk-persistence can be adequately managed on the target cluster. (Note that the volume or reads and writes may be significantly greater on clusters that function both as sources and targets for bidirectional replication.)

XDCR Failure Retry Interval

Specifies the interval during which XDCR waits before attempting to restart replication, after a server or network failure. The value-range is 1 to 300 seconds, with the default being 10. Lower values are suitable for handling more frequent failures.

XDCR Optimistic Replication Threshold

Specifies, in bytes, a compressed-document size, in the range of 0 to 20MB. The default is 256 Bytes. For documents larger than so specified, XDCR fetches metadata from the target cluster, in order to perform conflict resolution on the source, prior to replication. For documents that are smaller, XDCR replicates the document to the target without performing conflict resolution on the source (in consequence of which, conflict resolution is performed only on the target).

Note that a low setting risks increased latency, due to a higher number or metadata fetches; but may also reduce the number of required replications (due to source and target having identical copies of the document). A high setting lowers latency during replication, since the number of metadata fetches is reduced; but may also raise the replication-rate excessively, overwhelming either network or target cluster.

XDCR Statistics Collection Interval

Specifies, in seconds, how frequently XDCR Statistics are updated.

XDCR Network Usage Limit

Specifies the upper limit for network usage during replication, for the entire cluster, in MB per second. The default is 0, meaning no limit is applied. The limit applies only to mutations: it does not apply to other XDCR communications, such as those related to server topology and runtime statistics. Note that the limit for each individual node is the limit for the entire cluster divided by the number of nodes in the cluster.

XDCR Logging Level

Specifies the log level for the replication. Accepted values are Error, Info, Debug and Trace.

Note that the XDCR conflict resolution policy is set on a per bucket basis, during bucket creation: it cannot subsequently be changed. The default conflict resolution setting is Sequence number (which is based on revision ID). Alternatively, Timestamp (timestamp-based) can be selected. For more information, see XDCR Conflict Resolution.