[PR #403] [MERGED] followup(#374)(master): Add high watermark ratio flag to avoid trigger eviction until put failed #1544

Closed
opened 2026-10-29 21:28:19 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/403
Author: @maobaolong
Created: 5/26/2025
Status: ✅ Merged
Merged: 5/29/2025
Merged by: @stmatengss

Base: main ← Head: evictHighwatermark


📝 Commits (4)

  • d6bceec followup(#374)(master): Add high watermark ratio flag to avoid trigger eviction until put failed
  • 998ad60 Address comments
  • 2c3f262 fix type
  • a598aae Add related docs

📊 Changes

8 files changed (+38 additions, -12 deletions)

View changed files

📝 doc/en/mooncake-store-preview.md (+3 -0)
📝 doc/zh/mooncake-store-preview.md (+3 -0)
📝 docs/source/design/mooncake-store-preview.md (+3 -0)
📝 mooncake-store/include/master_service.h (+4 -2)
📝 mooncake-store/include/rpc_service.h (+3 -2)
📝 mooncake-store/include/types.h (+1 -0)
📝 mooncake-store/src/master.cpp (+5 -2)
📝 mooncake-store/src/master_service.cpp (+16 -6)

📄 Description

Description

  • Introduce a new flag for mooncake master
  • Default to 1.0 to keep consistent with original behavior.
  • Support to custom to a value between 0 ~ 1, e.g. 0.8 mean while the space used ratio achieved to 0.8 will trigger batch eviction.

How to test

  • Start master
/usr/local/lib/python3.12/dist-packages/mooncake/mooncake_master -v=1 -max_threads 64  -eviction_ratio=0.3 -eviction_high_watermark_ratio=0.7
  • Prepare mooncake.json
{
    "local_hostname": "localhost",
    "metadata_server": "etcd://localhost:2379",
    "protocol": "rdma",
    "device_name": "mlx5_bond_6",
    "global_segment_size": 167772160,
    "master_server_address": "localhost:50051"
}
  • MOONCAKE_CONFIG_PATH=../mooncake.json python3 /usr/local/lib/python3.12/dist-packages/mooncake/mooncake_store_service.py
  • Put 15MiB file into mooncakestore via mooncake_store_service.
curl -X PUT   -H "Transfer-Encoding: chunked"   -H "Content-Type: application/octet-stream"   --data-binary @-   "http://localhost:8080/api/put" < 15M_file.json
  • Result
    Found that the Storage usage cannot grow up to 100% but stop to grow up at 105.00 MB / 160.00 MB (65.6%), instead of allocation failure, it trigger eviction once usage over the specified high watermark ratio in time.

image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/403 **Author:** [@maobaolong](https://github.com/maobaolong) **Created:** 5/26/2025 **Status:** ✅ Merged **Merged:** 5/29/2025 **Merged by:** [@stmatengss](https://github.com/stmatengss) **Base:** `main` ← **Head:** `evictHighwatermark` --- ### 📝 Commits (4) - [`d6bceec`](https://github.com/kvcache-ai/Mooncake/commit/d6bceec23bcf7782aafd4a0f076b14588b098719) followup(#374)(master): Add high watermark ratio flag to avoid trigger eviction until put failed - [`998ad60`](https://github.com/kvcache-ai/Mooncake/commit/998ad60ecee17307e109440d8f60236ba88688d0) Address comments - [`2c3f262`](https://github.com/kvcache-ai/Mooncake/commit/2c3f26215f560e3bde9bdb18dad74816239bd807) fix type - [`a598aae`](https://github.com/kvcache-ai/Mooncake/commit/a598aaeae4597eb53dc39e260061c0552dab91cb) Add related docs ### 📊 Changes **8 files changed** (+38 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `doc/en/mooncake-store-preview.md` (+3 -0) 📝 `doc/zh/mooncake-store-preview.md` (+3 -0) 📝 `docs/source/design/mooncake-store-preview.md` (+3 -0) 📝 `mooncake-store/include/master_service.h` (+4 -2) 📝 `mooncake-store/include/rpc_service.h` (+3 -2) 📝 `mooncake-store/include/types.h` (+1 -0) 📝 `mooncake-store/src/master.cpp` (+5 -2) 📝 `mooncake-store/src/master_service.cpp` (+16 -6) </details> ### 📄 Description # Description - Introduce a new flag for mooncake master - Default to 1.0 to keep consistent with original behavior. - Support to custom to a value between 0 ~ 1, e.g. 0.8 mean while the space used ratio achieved to 0.8 will trigger batch eviction. # How to test - Start master ``` /usr/local/lib/python3.12/dist-packages/mooncake/mooncake_master -v=1 -max_threads 64 -eviction_ratio=0.3 -eviction_high_watermark_ratio=0.7 ``` - Prepare mooncake.json ```json { "local_hostname": "localhost", "metadata_server": "etcd://localhost:2379", "protocol": "rdma", "device_name": "mlx5_bond_6", "global_segment_size": 167772160, "master_server_address": "localhost:50051" } ``` - MOONCAKE_CONFIG_PATH=../mooncake.json python3 /usr/local/lib/python3.12/dist-packages/mooncake/mooncake_store_service.py - Put 15MiB file into mooncakestore via mooncake_store_service. ``` curl -X PUT -H "Transfer-Encoding: chunked" -H "Content-Type: application/octet-stream" --data-binary @- "http://localhost:8080/api/put" < 15M_file.json ``` - Result Found that the Storage usage cannot grow up to 100% but stop to grow up at `105.00 MB / 160.00 MB (65.6%)`, instead of allocation failure, it trigger eviction once usage over the specified high watermark ratio in time. ![image](https://github.com/user-attachments/assets/a1a664ed-f8b6-436b-98f2-6a0fe7fab855) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:28:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#1544
No description provided.