-
Notifications
You must be signed in to change notification settings - Fork 182
[DOC-14129]: Magma Compaction rate limiter documentation #4122
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
9
commits into
release/8.1
Choose a base branch
from
DOC-14129--8.1--Magma-Compaction-rate-limiter-documentation
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.
+109
−0
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3539c8a
[DOC-14129]: Magma Compaction rate limiter documentation
RayOffiah 006644f
Potential fix for pull request finding
RayOffiah 6c9d8f5
[DOC-14129]: Magma Compaction rate limiter documentation
RayOffiah e606a3a
Potential fix for pull request finding
RayOffiah 754336d
Potential fix for pull request finding
RayOffiah 89f14c8
[DOC-14129]: Magma Compaction rate limiter documentation
RayOffiah 9e8c1b2
[DOC-14129]: Magma Compaction rate limiter documentation
RayOffiah c914956
[DOC-14129]: Magma Compaction rate limiter documentation
RayOffiah 14330e3
[DOC-14129]: Magma Compaction rate limiter documentation
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
100 changes: 100 additions & 0 deletions
100
modules/rest-api/pages/rest-magma-compaction-rate-limiting.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,100 @@ | ||
| = Magma Compaction Rate Limiting | ||
| :description: This API is used to set the rate limit for Magma compaction threads. | ||
| :stem: asciimath | ||
| [abstract] | ||
| {description} | ||
|
|
||
| == Description | ||
|
|
||
| Use these API calls to limit the disk I/O bandwidth (in *bytes per second*) that the Magma Storage Engine Compaction may consume. | ||
| The limit is global to the Data Service and shared across all buckets on the node | ||
|
|
||
|
RayOffiah marked this conversation as resolved.
|
||
| NOTE: The limit setting is global, | ||
| even though the application of the setting is on a per-node basis. | ||
| This allows compactions on each node to consume a maximum of `compaction-rate-limit` bytes per second. | ||
|
|
||
| Compaction is a background maintenance activity that reclaims space from stale and deleted data and keeps data files efficient to read. | ||
| It operates on the same data files that front-end reads and writes use, so large bursts of compaction can consume enough disk I/O to slow front-end operations. | ||
| Rate limiting smooths those bursts into a steady background rate, keeping front-end performance predictable — at the cost of slower compaction. | ||
|
|
||
| === Usage | ||
|
|
||
| Rate limiting helps wherever compaction can surge and contend with front-end I/O, for example: | ||
|
|
||
| * Short burst, write heavy workloads, where spikes in writes drive spikes in compaction. | ||
|
|
||
| * Large collection drops, which mark a large amount of data for removal at once. | ||
|
|
||
| * Sudden large number document expirations, such as a batch of items with closer TTL range expiring together. | ||
|
|
||
| The trade-off is that compaction runs more slowly, so disk usage may stay higher for longer. | ||
| Set the limit low enough to protect front-end write bursts, but high enough that compaction keeps pace with the write rate. | ||
|
|
||
|
|
||
| == Recommended Value | ||
|
|
||
| A practical starting point is 100 MB/s (104857600 bytes/s), or about 10× your incoming write rate — estimated as writes per second per node × average document size. | ||
| For example, 10,000 writes/s of 1 KB documents is roughly 10 MB/s incoming, giving a ~100 MB/s limit. | ||
|
|
||
| == Settings | ||
|
|
||
| [cols="1,2,1"] | ||
| |=== | ||
| | Setting | Description| Range | ||
|
|
||
| | `magma_compaction_rate_limit` | ||
| | Controls the I/O bandwidth | ||
| (given in bytes per second) | ||
| that compactions on all the shards on one node consume. | ||
| Setting this value to 0 disables compaction rate limiting. | ||
| | stem:[0 … 2^64 - 1] | ||
| (default: 0) | ||
|
|
||
|
|
||
| |=== | ||
|
|
||
| == HTTP Methods and URIs | ||
|
|
||
| [source, shell] | ||
| ---- | ||
| GET /pools/default/settings/memcached/global | ||
| POST /pools/default/settings/memcached/global | ||
|
|
||
| ---- | ||
|
|
||
| == Examples | ||
|
|
||
| .Retrieve the compaction limit settings | ||
|
RayOffiah marked this conversation as resolved.
|
||
| [source, shell] | ||
| ---- | ||
| curl -u Administrator:password -X GET http://localhost:8091/pools/default/settings/memcached/global | ||
| ---- | ||
|
|
||
| Running this command returns the global settings: | ||
|
|
||
| [source, json] | ||
| ---- | ||
| { | ||
| "max_connections": 20000, | ||
| "system_connections": 5000, | ||
| "magma_compaction_rate_limit": 100 | ||
| } | ||
| ---- | ||
|
|
||
| .Setting the compaction rate | ||
| [source, shell] | ||
| ---- | ||
| curl -u Administrator:password -X POST localhost:8091/pools/default/settings/memcached/global \ | ||
| -d magma_compaction_rate_limit=500 | jq | ||
| ---- | ||
|
|
||
| The call executes and returns a JSON object containing the new setting. | ||
|
|
||
| [source, json] | ||
| ---- | ||
| { | ||
| "max_connections": 20000, | ||
| "system_connections": 5000, | ||
| "magma_compaction_rate_limit": 500 | ||
| } | ||
| ---- | ||
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
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.