Tune XDCR performance
Adjust the advanced settings to tune the XDCR performance.
By default, XDCR gets metadata for documents over 256 bytes twice before it performs conflict resolution for them at a destination cluster. If the document fails conflict resolution, it is discarded at the destination cluster. If a document is smaller than the number of bytes provided with this parameter (256 bytes), XDCR immediately puts it into the replication queue without getting metadata on the source cluster.
If the document is deleted on the source cluster, XDCR will no longer fetch metadata for this document before it sends the update to the destination cluster. Once the document reaches the destination cluster, XDCR will fetch the metadata and perform conflict resolution between documents. If the document ‘loses’ conflict resolution, Couchbase Server discards it on the destination cluster and keeps the version on the destination. This new feature improves replication latency, particularly when you replicate small documents.
There are tradeoffs when you change this setting.
If you put the setting low compared to the document size, XDCR will frequently check metadata and latency will be increased during replication. It also means that XDCR will get metadata before it puts the document into the replication queue and will get it again for the destination to perform conflict resolution. The advantage is that the network bandwidth is not misused, since XDCR will send fewer documents.
If you configure this setting very high relative to the document size, XDCR fetches less metadata and latency will improve during replication. High setting also means that you will increase the rate at which XDCR puts items immediately into the replication queue; this can potentially overwhelm your network, especially if you set a high number of parallel replicators. The number of documents sent by XDCR, therefore, might be increased, and network bandwidth misused.
The following advanced settings are related to XDCR performance:
|XDCR does not fetch metadata for the deleted documents.|
Change the document threshold with the REST URI
and the parameter for XDCR advanced settings.
Alternatively, change the XDCR
Optimistic Replication Threshold setting for the XDCR replication.