Back to Databend

Databend Meta Dependency Optimization Benchmark

benchmark/databend-meta-dependency-optimization-2026-05-14.md

1.2.925-patch-16.9 KB
Original Source

Databend Meta Dependency Optimization Benchmark

Date: 2026-05-15

This rerun supersedes the 2026-05-14 result and adds a 1024-client setting.

Scope

This benchmark compares the old Databend ups/main baseline before the Databend Meta dependency update with the current optimized Databend branch after the released Databend Meta tags were merged.

The benchmark target is Databend Meta in a 2-node cluster. The measured workload is upsert_kv.

Binary And Dependency Versions

Current optimized binary:

itemversion
Databend binary version1.2.910-nightly
Databend source commit used to build the benchmark binary221ecd54b7
min-compatible-client-version1.2.676
data-versionV004(2024-11-11: WAL based raft-log)
databend-metav260512.1.0
databend-meta-clientv260205.9.0
openraft0.10.0-alpha.20
raft-log0.4.2

Baseline binary:

itemversion
Databend binary version1.2.910-nightly
Databend source commit used to build the benchmark binarya2661824e3
min-compatible-client-version1.2.676
data-versionV004(2024-11-11: WAL based raft-log)
databend-metav260428.3.0
databend-meta-clientv260205.8.0
openraft0.10.0-alpha.19
raft-log0.4.0

The benchmark client is the current optimized databend-metabench binary for both sides. The current rows were rerun after databend-metabench switched its benchmark-local latency histogram to base2histogram; the baseline rows keep the earlier raw reports. The leader and follower in each run use the same server build.

Dependency Optimization

The optimized branch uses released Databend Meta tags that include the raft-log WAL flush optimizations:

  • bounded group-commit wait for WAL flushes;
  • configurable flush batch size;
  • vectored batch writes;
  • WAL flush latency percentiles exposed through raft-log stats;
  • richer meta service logging for raft-log and Openraft runtime stats.

Benchmark Setup

All runs use scripts/benchmark/meta-cluster-bench.py with a 2-node Databend Meta cluster. Workload is upsert_kv.

clientsbuildops/clienttotal opsclient pool
4both10000400004 effective
64both6254000016
256both1563993616
1024baseline393993616
1024current15615974416

Raw reports and logs were generated under:

text
/Users/drdrxp/xp/vcs/sessions/stream/bench-reports/databend-meta-final-20260515

Result

clientsbuildqpsdeltawall msavg usp50 usp90 usp99 usmax usslow RPCslow IO leader/follower
4baseline172.9-2313662312922000300006000095521481210/89
4current193.8+12.1%2064472063719362236343379281721361101/92
64baseline2807.0-14250226562200030000450009929259396/6
64current3210.8+14.4%12458198061964324278302124798500/0
256baseline8920.3-44772832120000250002000001183675257162/4
256current12127.5+36.0%3293206491956724897398239076000/0
1024baseline24262.5-164639864350004500030000036768200/0
1024current23440.1-3.4%68154285441693577448063029854300/0

Raft-log Stats

The new raft-log stats are available only in the current optimized build. For the 1024-client current rerun, the server-side raft-log and runtime rows use the last stats sample emitted by the server logs; the client-side summary in the Result table is the final metabench summary.

clientsavg batchmax batchavg group wait usavg queued wait us/writeavg write us/batchavg sync us/batchsync p99 usbatch p99 ussubmitted->persisted p90/p99
4141297486837725556117571585618845/23096
6419551222497433155605118781525020211/24714
256541441150478234105425116721398620067/23043
1024992681160438630895195112211375916452/19245

Stage Latency

clientsbuildsubmitted->persisted p90/p99 usproposed->applied p90/p99 us
4baseline15780/2106024422/29465
4current18845/2309620515/26762
64baseline22213/4681125956/46811
64current20211/2471423295/26605
256baseline22035/2548525863/28206
256current20067/2304322676/24424
1024baseline33916/4694648169/54753
1024current16452/1924556281/57243

Interpretation

The current optimized dependency stack improves throughput in the 4, 64, and 256 client runs:

  • 4 clients: 172.9 -> 193.8 qps, +12.1%;
  • 64 clients: 2807.0 -> 3210.8 qps, +14.4%;
  • 256 clients: 8920.3 -> 12127.5 qps, +36.0%.

The 64-client and 256-client runs show the clearest win: the current build removes the slow RPC and slow IO outliers seen in the baseline run, and p99 client latency improves from 45ms -> 30.2ms at 64 clients and from 200ms -> 39.8ms at 256 clients.

The 1024-client current run was rerun as 1024 clients x 156 ops/client, about 6.8s total, after switching databend-metabench from the old manual latency buckets to base2histogram. Client-side qps is slightly lower than the old baseline row (24262.5 -> 23440.1 qps, -3.4%) and p90 client latency is worse (45ms -> 57.7ms). The more accurate client-side p99 is 80.6ms; the previous 300ms value was the old coarse bucket upper bound, not a precise percentile estimate.

On the server side, the rerun still shows a faster persistence stage: submitted->persisted p90 drops from 33916us to 16452us. The remaining 1024-client latency is mainly after persistence: proposed->applied p90 is 56281us, with a large persisted->committed component in the runtime stats.

The persistence path is still a major cost. In the optimized build, submitted->persisted remains roughly 16ms to 20ms at p90 across these runs. The current optimization mainly amortizes the sync cost by batching more writes per WAL flush; it does not eliminate the underlying fsync latency.

Raw Files

runreport
baseline 4 clientsbaseline-c4-pool16.report.txt
current 4 clientscurrent-c4-pool16-base2histogram.report.txt
baseline 64 clientsbaseline-c64-pool16.report.txt
current 64 clientscurrent-c64-pool16-base2histogram-r2.report.txt
baseline 256 clientsbaseline-c256-pool16.report.txt
current 256 clientscurrent-c256-pool16-base2histogram.report.txt
baseline 1024 clientsbaseline-c1024-pool16.report.txt
current 1024 clientscurrent-c1024-n156-pool16-base2histogram.report.txt