-
Notifications
You must be signed in to change notification settings - Fork 182
[DOC-13921]: XDCR: Tuners to Throttle DCP Control Flow & Async Events Channel Length #4107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RayOffiah
wants to merge
4
commits into
release/8.1
Choose a base branch
from
DOC-13921--XDCR-Tuners-to-Throttle-DCP-Control-Flow--Async-Events-Channel-Length
base: release/8.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
365e446
[DOC-13921]: XDCR: Tuners to Throttle DCP Control Flow & Async Events…
RayOffiah c959a1f
Update modules/xdcr-reference/pages/xdcr-lowering-memory-footprint.adoc
RayOffiah 79f701a
Update modules/xdcr-reference/pages/xdcr-lowering-memory-footprint.adoc
RayOffiah 09756e6
Update modules/rest-api/pages/rest-xdcr-adv-settings.adoc
RayOffiah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
modules/xdcr-reference/pages/xdcr-lowering-memory-footprint.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| = Lowering the Memory Footprint in XDCR | ||
| :description: Using new global settings (introduced in Couchbase Server 8.1) to lower the memory footprint of Cross Data Center Replication. | ||
| :stem: asciimath | ||
|
|
||
| [abstract] | ||
| {description} | ||
|
|
||
| XDCR has 2 global replication settings which can be used to lower the memory footprint of a running replication: | ||
|
|
||
| dcpFlowControlThrottle:: | ||
| This is a percentage applied to the default value of both: | ||
| + | ||
| -- | ||
| * The `connection_buffer_size` set by XDCR replication for the DCP connection to KV (stem:[1024 times 1024] bytes by default) | ||
| * Length of the channel used by XDCR replication to buffer incoming items (via the DCP connection) from KV (20000 by default) | ||
| -- | ||
| + | ||
| Effective value for both the above parameters becomes: | ||
| + | ||
| -- | ||
| stem:[("<default value> " times " dcpFlowControlThrottle") / 100] | ||
| -- | ||
| + | ||
| Reducing this setting from its default value of 100 causes a decrease in the max number of documents that can fit into XDCR's memory buffer. This limitation on the size of the buffer results in a drop in the replication throughput, thereby reducing the memory footprint of the replication. | ||
|
|
||
| componentEventsChanLength:: | ||
| This sets the default length of the channels being used by event-listeners to buffer various internal events before processing. | ||
| + | ||
| Reducing this setting from its default value of 10,000 lowers the number of buffer slots available to each of the event-listeners, thereby reducing the memory allocated. | ||
| However, it may also cause a drop in replication throughput. | ||
|
|
||
| NOTE: Changing these replication settings for an ongoing replication causes it to restart from the last checkpoint sequence number | ||
| so that the new values can take effect. | ||
|
|
||
| == Monitoring the Health of a Throttled Replication | ||
|
|
||
| Lowering either of the above two settings may adversely affect the throughput of the replication, and care must be taken to not over-throttle the replication. | ||
|
|
||
| The health of the replication in response to the throttling can be measured via the following Prometheus metrics expression: | ||
|
|
||
| [source, text] | ||
| ---- | ||
| clamp_min(xdcr_changes_left_total\{pipelineType="Main", sourceBucketName="<A>", targetBucketName="<B>", targetClusterUUID="<C>"} - ignoring(name) rate(xdcr_docs_processed_total[1m]), 0) | ||
|
RayOffiah marked this conversation as resolved.
|
||
| ---- | ||
|
|
||
| The graph of the above expression will have a negative slope, or hover/plateau around zero, when the replication is in a healthy state. | ||
|
|
||
| If the graph has a consistently positive slope or plateaus without ever touching the X-axis, it implies that the replication is not able to keep up with the rate of mutations on the Source bucket. | ||
| In such a situation, any throttling imposed on the replication needs to be reversed. | ||
|
|
||
| In the event that a Source cluster node (running a throttled replication) is running out of disk space, it's advisable to reverse the throttling to alleviate any potential excesses in disk usage being caused to KV by the replication having a reduced `connection_buffer_size`. | ||
|
|
||
| == Proposed Values for these Settings | ||
|
|
||
| There is no exact formula to propose the value for *dcpFlowControlThrottle*, since it depends on the source bucket conditions (rate of mutations, size of documents, etc.) | ||
| Qualitatively, a replication whose source bucket has a lower mutation rate can be throttled more than a replication with a higher mutation rate. | ||
|
|
||
| In practice, it's recommended to reduce the *dcpFlowControlThrottle* percentage incrementally from the default value of 100, then check the effect of the new value on the replication health graph described in the previous section. | ||
| If the graph starts diverging from zero | ||
| (specifically, it has a consistent positive slope), then one must undo the setting change to a value that does not have the same issue. | ||
| For example, use an incremental decrease (100 → 75 → 50 → …) while monitoring the graph. | ||
|
|
||
| Similar incremental changes are advised for the *componentEventsChanLength* setting. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.