Repository navigation
[Store] Add synthetic master workload benchmark - #3147
zhangzuo21 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new standalone benchmark, master_synthetic_bench, intended to generate configurable mixed (Exist/Put/Get) open-loop workloads against an already-running Mooncake master, plus accompanying usage documentation and the minimal CMake target to build it.
Changes:
- Add
master_synthetic_benchC++ benchmark implementing per-segment open-loop scheduling, worker pools, segment mount/heartbeat/remount, and committed-key tracking for hit-ratio sampling. - Add English usage and parameter documentation for the new benchmark (
MASTER_SYNTHETIC_BENCH.md). - Register the new benchmark executable in
mooncake-store/benchmarks/CMakeLists.txt.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| mooncake-store/benchmarks/MASTER_SYNTHETIC_BENCH.md | Adds build/run instructions, workload semantics, parameters, and exit-code documentation for the new benchmark. |
| mooncake-store/benchmarks/master_synthetic_bench.cpp | Implements the synthetic benchmark: segment lifecycle + heartbeat, open-loop request scheduling, task queues, and RPC execution logic. |
| mooncake-store/benchmarks/CMakeLists.txt | Adds the master_synthetic_bench executable target and links it against mooncake_store. |
Comments suppressed due to low confidence (1)
mooncake-store/benchmarks/master_synthetic_bench.cpp:412
- BatchGetReplicaList failure accounting similarly ignores short responses. If fewer results are returned than requested keys, the benchmark should treat the missing entries as failures so rpc_failure_events reflects partial/bad responses.
const auto counts =
CountExpectedResults(master_client_.BatchGetReplicaList(keys));
if (counts.second != 0) {
stats_.rpc_failure_events.fetch_add(1,
std::memory_order_relaxed);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cmake -S . -B build \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DBUILD_UNIT_TESTS=ON | ||
| cmake --build build --target master_synthetic_bench -j |
| const long double nanoseconds = seconds * 1'000'000'000.0L; | ||
| return std::chrono::nanoseconds( | ||
| std::max<int64_t>(1, static_cast<int64_t>(nanoseconds))); | ||
| } |
| const auto results = master_client_.BatchExistKey(keys); | ||
| uint64_t failed = 0; | ||
| uint64_t found = 0; | ||
| uint64_t missing = 0; | ||
| for (const auto& result : results) { | ||
| if (!result.has_value()) { | ||
| ++failed; | ||
| } else { | ||
| if (*result) { | ||
| ++found; | ||
| } else { | ||
| ++missing; | ||
| } | ||
| } | ||
| } | ||
| stats_.exist_true_items.fetch_add(found, std::memory_order_relaxed); | ||
| stats_.exist_false_items.fetch_add(missing, | ||
| std::memory_order_relaxed); | ||
| if (failed != 0) { | ||
| stats_.rpc_failure_events.fetch_add(1, | ||
| std::memory_order_relaxed); | ||
| } |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…nch (PR kvcache-ai#3147) read_path_bench: in-process master metadata read-path microbenchmark used for the kvcache-ai#3670/kvcache-ai#3671 fast-path A/B (GetReplicaList throughput; 100k objects, 32 threads, 160k reqs -> +0.12% vs ca09c18 baseline). master_synthetic_bench (PR kvcache-ai#3147): configurable synthetic master workload benchmark against a live mooncake_master (mooncake::MasterClient, gRPC). Used to measure the eviction scenario (medium + high load). Adapted BatchPutEnd to the current vector<ObjectMeta> client API and added per-RPC latency percentiles (p50/p99/p999, us) for exist/get/put. Measured high-load eviction p99/p999 drop to ~1.5-7 ms after kvcache-ai#3671 route sharding (vs ~130-280 ms baseline).
…nch (PR kvcache-ai#3147) read_path_bench: in-process master metadata read-path microbenchmark used for the kvcache-ai#3670/kvcache-ai#3671 fast-path A/B (GetReplicaList throughput; 100k objects, 32 threads, 160k reqs -> +0.12% vs ca09c18 baseline). master_synthetic_bench (PR kvcache-ai#3147): configurable synthetic master workload benchmark against a live mooncake_master (mooncake::MasterClient, gRPC). Used to measure the eviction scenario (medium + high load). Adapted BatchPutEnd to the current vector<ObjectMeta> client API and added per-RPC latency percentiles (p50/p99/p999, us) for exist/get/put. Measured high-load eviction p99/p999 drop to ~1.5-7 ms after kvcache-ai#3671 route sharding (vs ~130-280 ms baseline).
Description
This PR adds
master_synthetic_bench, a standalone benchmark that generates a configurable, stateful workload for an already-running Mooncake master.The existing
master_benchfocuses on driving one selected operation at maximum throughput. The new benchmark is intended for mixed and rate-controlled workloads:BatchPutStart/BatchPutEndtransactions;Only keys that successfully complete both PutStart and PutEnd are added to the committed-key pool used by later Exist and Get requests.
The benchmark connects to the master through
--master_server. It does not start or modify the master, does not require a trace file, and does not introduce additional master or sender metrics.This PR contains only:
There are no changes to existing master behavior or production APIs.
Module
mooncake-transfer-engine)mooncake-store)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?