Skip to content

Valkey updates#2

Open
dvalinrh wants to merge 2 commits into
mainfrom
valkey_updates
Open

Valkey updates#2
dvalinrh wants to merge 2 commits into
mainfrom
valkey_updates

Conversation

@dvalinrh

@dvalinrh dvalinrh commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Adding valkey test.
This replaces the redis test in phoronix. Addinf to the zathras test defs will occur after push.

JIRA: https://redhat.atlassian.net/browse/RPOPC-1265
Git issue: #1

Run info
Use default settings, 5 iterations is enough to produce stable results.

Code has been reviewed through claude.

Results csv file
Note: Time period given is the time for 1 iteration. There is no way to differentiate the individual tests. pcp will have the time periods for the iterations, this is just to keep the results csv files all the same.

Value present in the csv file is the average for all the iterations.

Test general meta start

Test: valkey

Results version: v1.00

Host: m6i.xlarge

Sys environ: aws

Tuned: virtual-guest

OS: 6.12.0-124.38.1.el10_1.x86_64

Numa nodes: 1

CPU family: Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz

Number cpus: 4

Memory: 15813884kB

Test general meta end

Test,RPS,Start_Date,End_Date
XADD,159957,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
MSET_10_keys,159792,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
LRANGE_600_first_600_elements,20748,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
LRANGE_500_first_500_elements,23492,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
LRANGE_300_first_300_elements,37181,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
LRANGE_100_first_100_elements,84175,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
LPUSH_needed_to_benchmark_LRANGE,199933,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
ZPOPMIN,199933,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
ZADD,199933,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
SPOP,199900,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
HSET,199900,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
SADD,199933,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
RPOP,199966,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
LPOP,199933,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
RPUSH,199900,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
LPUSH,199900,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
INCR,199900,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
GET,199900,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
SET,199900,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
PING_MBULK,199933,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z
PING_INLINE,199966,2026-07-08T11:19:26Z,2026-07-08T11:21:04Z

@dvalinrh dvalinrh requested a review from sayalibhavsar July 8, 2026 13:02
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a full user guide for the benchmark wrapper, including setup, run flow, options, metrics, output locations, examples, troubleshooting, and platform notes.
    • Added support for combining multiple benchmark runs into a single summarized results file with outlier trimming for more stable averages.
  • Bug Fixes

    • Improved result collection so each run is tracked separately and benchmark output is finalized more reliably.
    • Updated the default workload and thread handling to better reflect the requested benchmark configuration.

Walkthrough

This PR updates the Valkey benchmark wrapper script (valkey.sh) to increase default request volume, restructure per-iteration benchmark execution with explicit systemd lifecycle management, scope CSV extraction per iteration, add multi-iteration result aggregation with outlier trimming, and update result persistence. It also removes stale verification JSON data and replaces README.md with an expanded user guide.

Changes

Valkey benchmark script changes

Layer / File(s) Summary
Benchmark execution and lifecycle management
valkey/valkey.sh
total_requests default increased to 400000; execute_valkey derives run_threads from the threads argument, scopes output files per iteration (valkey_iter_<iter>...), and wraps each run with systemctl start/--wait/status/stop; per-test value extraction now greps only current iteration CSVs.
Result aggregation and persistence
valkey/valkey.sh
New generate_combine_report function averages per-test RPS across iterations into valkey_results.csv, trimming min/max when iterations exceed 4; adds /etc/rc.d/rc.local permission fix; main flow calls report generation, PCP shutdown, and save_results with updated file globs.

Verification data cleanup

Layer / File(s) Summary
Cleared verification results
valkey/valkey_verify.json
Removes the previously stored JSON array of benchmark verification results.

README documentation rewrite

Layer / File(s) Summary
Overview, options, and workflow documentation
README.md
Adds title, description, command-line options, and detailed workflow explanation covering setup, thread generation, and aggregation rules.
Dependencies, operations, metrics, and outputs
README.md
Documents dependencies, usage, tested operations, reported metrics, and output artifacts.
Usage examples and behavior details
README.md
Adds runnable examples and documents thread selection and multi-iteration averaging behavior.
Return codes and operational notes
README.md
Adds return-code documentation and operational notes, tuning guidance, troubleshooting, and references.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MainFlow
  participant execute_valkey
  participant systemctl
  participant ValkeyBenchmark
  participant generate_combine_report

  MainFlow->>execute_valkey: run iteration(iter, threads)
  execute_valkey->>systemctl: start valkey
  systemctl-->>execute_valkey: --wait, status
  execute_valkey->>ValkeyBenchmark: run benchmark, write valkey_iter_<iter>_*.csv
  execute_valkey->>systemctl: stop valkey
  MainFlow->>generate_combine_report: aggregate all iterations
  generate_combine_report-->>MainFlow: valkey_results.csv (averaged, trimmed)
  MainFlow->>MainFlow: save_results
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change but too generic to convey the main update. Use a concise, specific title like "Add Valkey benchmark test and replace Redis test".
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description matches the changeset and explains that Valkey replaces the Redis test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@valkey/valkey.sh`:
- Around line 250-278: The aggregation in generate_combine_report is brittle for
very high RPS and missing per-iteration rows; update the loop over test_list/seq
so it safely handles absent grep matches from valkey_iter_${iter}.csv without
arithmetic failures, and replace the fixed low sentinel with a value derived
from the first valid sample (or another unbounded initialization). Also adjust
the avg calculation at the end of generate_combine_report so it preserves
fractional precision instead of truncating to an integer.
- Around line 191-197: The Valkey startup flow in valkey.sh uses a malformed
systemctl invocation, so the benchmark may begin before the service is ready.
Fix the startup sequence around the systemctl start/status calls by replacing
the invalid wait usage with a valid readiness check or wait-capable start
pattern before running valkey-benchmark, and keep the benchmark launch dependent
on Valkey being fully up.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 72a04337-916c-45ee-aea8-987350e78280

📥 Commits

Reviewing files that changed from the base of the PR and between 6e11b48 and 76aee6b.

📒 Files selected for processing (3)
  • README.md
  • valkey/valkey.sh
  • valkey/valkey_verify.json
💤 Files with no reviewable changes (1)
  • valkey/valkey_verify.json

Comment thread valkey/valkey.sh
Comment thread valkey/valkey.sh
Comment on lines +250 to +278
generate_combine_report()
{
rm -f valkey_results.csv
for tst in $test_list
do
high=0
low=9999999
sum=0
for iter in $(seq 1 1 $to_times_to_run); do
file="valkey_iter_${iter}.csv"
rval=$(grep ^${tst}, $file | cut -d, -f2 |cut -d. -f1)
let "sum=${sum}+${rval}"
if [[ $rval -gt $high ]]; then
high=$rval
fi
if [[ $rval -lt $low ]]; then
low=$rval
fi
done
if [[ $to_times_to_run -gt 4 ]]; then
let "samples=${to_times_to_run}-2"
let "sum=${sum}-${high}-${low}"
else
samples=${to_times_to_run}
fi
avg=$(echo $sum/$samples | bc)
echo ${tst},$avg >> valkey_results.csv
done
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Aggregation is fragile for high RPS and missing samples.

Two robustness gaps in generate_combine_report:

  • low=9999999 is a fixed sentinel. valkey-benchmark RPS for simple ops (e.g. PING, GET) can exceed ~10M on fast hardware/many threads; if every sample is above the sentinel, low never updates and the outlier trim subtracts a bogus value, skewing the average.
  • If a test is missing from any valkey_iter_${iter}.csv, rval is empty and both let "sum=${sum}+${rval}" and [[ $rval -gt $high ]] raise arithmetic errors for that iteration.

Also, avg=$(echo $sum/$samples | bc) uses bc's default scale 0, so the reported average RPS is integer-truncated.

♻️ Suggested hardening
 		high=0
-		low=9999999
+		low=
 		sum=0
 		for iter in $(seq 1 1 $to_times_to_run); do
 			file="valkey_iter_${iter}.csv"
 			rval=$(grep ^${tst}, $file | cut -d, -f2 |cut -d. -f1)
+			[[ -z $rval ]] && continue
 			let "sum=${sum}+${rval}"
 			if [[ $rval -gt $high ]]; then
 				high=$rval
 			fi
-			if [[ $rval -lt $low ]]; then
+			if [[ -z $low || $rval -lt $low ]]; then
 				low=$rval
 			fi
 		done
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
generate_combine_report()
{
rm -f valkey_results.csv
for tst in $test_list
do
high=0
low=9999999
sum=0
for iter in $(seq 1 1 $to_times_to_run); do
file="valkey_iter_${iter}.csv"
rval=$(grep ^${tst}, $file | cut -d, -f2 |cut -d. -f1)
let "sum=${sum}+${rval}"
if [[ $rval -gt $high ]]; then
high=$rval
fi
if [[ $rval -lt $low ]]; then
low=$rval
fi
done
if [[ $to_times_to_run -gt 4 ]]; then
let "samples=${to_times_to_run}-2"
let "sum=${sum}-${high}-${low}"
else
samples=${to_times_to_run}
fi
avg=$(echo $sum/$samples | bc)
echo ${tst},$avg >> valkey_results.csv
done
}
generate_combine_report()
{
rm -f valkey_results.csv
for tst in $test_list
do
high=0
low=
sum=0
for iter in $(seq 1 1 $to_times_to_run); do
file="valkey_iter_${iter}.csv"
rval=$(grep ^${tst}, $file | cut -d, -f2 |cut -d. -f1)
[[ -z $rval ]] && continue
let "sum=${sum}+${rval}"
if [[ $rval -gt $high ]]; then
high=$rval
fi
if [[ -z $low || $rval -lt $low ]]; then
low=$rval
fi
done
if [[ $to_times_to_run -gt 4 ]]; then
let "samples=${to_times_to_run}-2"
let "sum=${sum}-${high}-${low}"
else
samples=${to_times_to_run}
fi
avg=$(echo $sum/$samples | bc)
echo ${tst},$avg >> valkey_results.csv
done
}
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 258-258: to_times_to_run is referenced but not assigned.

(SC2154)


[info] 258-258: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 260-260: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 260-260: Double quote to prevent globbing and word splitting.

(SC2086)


[style] 261-261: Instead of 'let expr', prefer (( expr )) .

(SC2219)


[style] 270-270: Instead of 'let expr', prefer (( expr )) .

(SC2219)


[style] 271-271: Instead of 'let expr', prefer (( expr )) .

(SC2219)


[info] 275-275: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 276-276: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 276-276: Double quote to prevent globbing and word splitting.

(SC2086)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@valkey/valkey.sh` around lines 250 - 278, The aggregation in
generate_combine_report is brittle for very high RPS and missing per-iteration
rows; update the loop over test_list/seq so it safely handles absent grep
matches from valkey_iter_${iter}.csv without arithmetic failures, and replace
the fixed low sentinel with a value derived from the first valid sample (or
another unbounded initialization). Also adjust the avg calculation at the end of
generate_combine_report so it preserves fractional precision instead of
truncating to an integer.

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