feat: expose backpressure and batching options in the perf client - #420
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The client builder has
maxPendingBytes,maxWriteBatchesInFlight,maxReadBatchesInFlightandbatchingThreadsto 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 inPerfClient. Their defaults come from theOxiaClientBuilderImplconstants:--max-pending-bytesmaxPendingBytes0disables)--max-write-batches-in-flightmaxWriteBatchesInFlight--max-read-batches-in-flightmaxReadBatchesInFlight--batching-threadsbatchingThreadsAdd
SizeConverter, so--max-pending-bytesaccepts a size with a binary unit suffix (512K,10M,1G,2T, case-insensitive). A plain number is still read as bytes. Invalid input such as10Xor1.5Ggives a normal command-line error:Verification
SizeConverterTest(plain bytes, each suffix, lowercase, invalid input and overflow), the first unit test in theperfmodule.:perf:testand:perf:spotlessCheckpass.--helplists the new flags, and invalid sizes are rejected as shown above. Not run against a server.