Fix random __data__ generation
#326
Merged
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.
This PR addresses two issues in
--random-datageneration:value buffer mutation wrap-around caused repeated patterns.
The mutation index is designed to avoid generating a completely new random value on every request by mutating an existing buffer.
However, once the index wrapped, the mutation pattern repeated, significantly reducing randomness.
Initial value buffer was not seeded per client, even when
--distinct-client-seedwas enabled.As a result, multiple clients generated identical initial buffers, again reducing randomness across workloads.
These issues reduced entropy and could distort benchmark results or the realism of workload simulations.
What this PR changes
Random value buffers are now:
Impact
Test: 100% SETs, 36 bytes random values, 50 clients (each with a different seed), 10 seconds test time.
How to reproduce and measure
redis-server --save "" --io-threads 4redis-cli monitor > executed-cmds.log./memtier_benchmark --ratio=1:0 --data-size=36 --random-data --clients=50 --distinct-client-seed --threads=1 --test-time 10 --hide-histogramredis-cli monitorwith ctrl + c (or equivalent)sed -n 's/.* "\(.*\)"$/\1/p' executed-cmds.log | sort | uniq -c | sort -nr | lessImpact on performance
No significant performance degradation was observed.