Skip to content

feat: expose backpressure and batching options in the perf client - #420

Merged
merlimat merged 1 commit into
oxia-db:mainfrom
merlimat:perf-client-backpressure-options
Oct 3, 2026
Merged

merlimat merged 1 commit into
oxia-db:mainfrom
merlimat:perf-client-backpressure-options

Conversation

@merlimat

@merlimat merlimat commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Motivation

The client builder has maxPendingBytes, maxWriteBatchesInFlight, maxReadBatchesInFlight and batchingThreads to control backpressure and batching, but the perf client offers no way to set them, so they cannot be tuned or compared when benchmarking.

Modifications

  • Add four flags to PerfArguments, passed through to the builder in PerfClient. Their defaults come from the OxiaClientBuilderImpl constants:

    Flag Builder option Default
    --max-pending-bytes maxPendingBytes 256 MiB (0 disables)
    --max-write-batches-in-flight maxWriteBatchesInFlight 4
    --max-read-batches-in-flight maxReadBatchesInFlight 4
    --batching-threads batchingThreads 1
  • Add SizeConverter, so --max-pending-bytes accepts a size with a binary unit suffix (512K, 10M, 1G, 2T, case-insensitive). A plain number is still read as bytes. Invalid input such as 10X or 1.5G gives a normal command-line error:

    "--max-pending-bytes": couldn't convert "10X" to a size (e.g. 512K, 10M, 1G)
    

Verification

  • Added SizeConverterTest (plain bytes, each suffix, lowercase, invalid input and overflow), the first unit test in the perf module.
  • :perf:test and :perf:spotlessCheck pass.
  • Ran the shadow jar: --help lists the new flags, and invalid sizes are rejected as shown above. Not run against a server.

Add --max-pending-bytes, --max-write-batches-in-flight,
--max-read-batches-in-flight and --batching-threads to the perf client,
passed through to the corresponding OxiaClientBuilder options.
--max-pending-bytes accepts sizes with a binary unit suffix (e.g. 512K,
10M, 1G).

Signed-off-by: Matteo Merli <mmerli@apache.org>
@merlimat
merlimat merged commit bdb3601 into oxia-db:main Oct 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant