Skip to content

[DOC-14129]: Magma Compaction rate limiter documentation#4122

Open
RayOffiah wants to merge 6 commits into
release/8.1from
DOC-14129--8.1--Magma-Compaction-rate-limiter-documentation
Open

[DOC-14129]: Magma Compaction rate limiter documentation#4122
RayOffiah wants to merge 6 commits into
release/8.1from
DOC-14129--8.1--Magma-Compaction-rate-limiter-documentation

Conversation

@RayOffiah
Copy link
Copy Markdown
Contributor

@RayOffiah RayOffiah requested a review from ggray-cb May 27, 2026 10:28
@RayOffiah RayOffiah self-assigned this May 27, 2026
@RayOffiah RayOffiah added the enhancement New feature or request label May 27, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds REST API documentation for configuring Magma compaction rate limiting and exposes the page through the REST API navigation and memory/storage API index.

Changes:

  • Added a new Magma Compaction Rate Limiting REST API page with settings, endpoints, and examples.
  • Added the new page to the Memory and Storage API navigation.
  • Added GET/POST endpoint entries to the memory and storage REST API table.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
modules/ROOT/nav.adoc Adds the new REST API page to the Memory and Storage API nav.
modules/rest-api/partials/rest-memory-and-storage-table.adoc Lists the new Magma compaction rate limiting endpoint entries.
modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Documents the Magma compaction rate limiting settings and examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/partials/rest-memory-and-storage-table.adoc Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/partials/rest-memory-and-storage-table.adoc Outdated
Comment thread modules/rest-api/partials/rest-memory-and-storage-table.adoc Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
Comment thread modules/rest-api/pages/rest-magma-compaction-rate-limiting.adoc Outdated
@RayOffiah RayOffiah requested a review from Copilot May 27, 2026 11:37
Copy link
Copy Markdown
Contributor

@ggray-cb ggray-cb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have one question/suggestion on adding info about when these limits should be enabled. Otherwise, looks good.

Use these API calls to set the rate limit (in bytes per second).
This setting is a global rate limit for the Memcached process shared across buckets.
The strategy for this rate limiting is to set the block waiting time on the compaction threads to maintain the specified limits.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any guidance we can give for customers as to when they should enable rate limiting? It seems off by default, so I assume they would only enable it if they wre seeing some sort of issue?

Copy link
Copy Markdown
Contributor Author

@RayOffiah RayOffiah May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I'll check with the devs.

@RayOffiah RayOffiah force-pushed the DOC-14129--8.1--Magma-Compaction-rate-limiter-documentation branch from 700b8dd to 0dad8d7 Compare May 29, 2026 08:09
RayOffiah and others added 6 commits May 29, 2026 09:28
Added page detailing REST call for magma compaction.

Update menu navigation and index page.

Signed-off-by: Ray Offiah <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Changes made following co-pilot review.

Signed-off-by: Ray Offiah <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Changes made following co-pilot review.
@RayOffiah RayOffiah force-pushed the DOC-14129--8.1--Magma-Compaction-rate-limiter-documentation branch from 0dad8d7 to 3fdb80e Compare May 29, 2026 08:29
@anuthan
Copy link
Copy Markdown

anuthan commented May 29, 2026

@t3rm1n4l Could you help with when the users might want to use this setting, and when they shouldn't?

@t3rm1n4l
Copy link
Copy Markdown

t3rm1n4l commented May 29, 2026

I would recommend removing the magma_enable_compaction_dataonly_ratelimiting setting from documentation. It's confusing to the customer and it's an advanced setting that we are still testing. We can also remove the detailed description about compaction types.

Some additional info and rephrase suggestions..


Description

Use these API calls to limit the disk I/O bandwidth (in bytes per second) that Magma Storage Engine Compaction may consume. The limit is global to the Data Service and shared across all buckets on the node

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.

When to use it

Rate limiting helps wherever compaction can surge and contend with front-end I/O, for example:

  • Bursty 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.

@t3rm1n4l
Copy link
Copy Markdown

@shivaniguptacb Please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants