Skip to content

Support plain command-file input for arbitrary command corpora #359

@jeremyplichta

Description

@jeremyplichta

Title: Support plain command-file input for arbitrary command corpora

Summary

Please add a native option to read arbitrary Redis commands from a plain text file, one command per line, without requiring users to expand every command into a separate --command ... CLI argument.

Why this would help

Today, memtier_benchmark supports:

  • --command for one or more explicitly repeated CLI arguments
  • --monitor-input for replaying Redis MONITOR output

What is missing is a simple mode for workloads like:

  • commands.txt
  • each line is a complete Redis command
  • memtier picks from that file during the run, either sequentially or randomly

This would be very useful for realistic benchmark workloads where engineers want to replay a corpus of many different queries or commands without having to generate a massive argv list.

Example use case

Suppose I have a file like this:

FT.SEARCH idx:products "@brand:{ACME} @country:{USA}" LIMIT 0 10 DIALECT 2
FT.SEARCH idx:products "@brand:{ACME} @state:{CA} @country:{USA}" LIMIT 0 10 DIALECT 2
FT.SEARCH idx:products "@brand:{ACME} (@city:{SAN JOSE} | @postal:{95131})" LIMIT 0 10 DIALECT 2
GET product:1001
GET product:1002

It would be great to run something like:

memtier_benchmark \
  -s redis.example.com -p 6379 \
  --command-file commands.txt \
  --command-file-pattern R \
  --test-time 300 -c 50 -t 4

Current workaround

The only workaround I found is to expand the file into many repeated flags:

memtier_benchmark \
  --command "cmd1" --command-ratio 1 \
  --command "cmd2" --command-ratio 1 \
  --command "cmd3" --command-ratio 1 \
  ...

This works, but it is awkward when the corpus is large.

Proposed feature

Something along these lines would solve it:

  • --command-file <path>
  • one Redis command per line
  • ignore blank lines and # comments
  • --command-file-pattern S|R
    • S: sequential
    • R: random
  • optional --command-stats-breakdown=line integration so results can still be grouped by line

Why this is different from --monitor-input

--monitor-input is useful for replaying Redis MONITOR output, but it is not the same as a plain corpus of arbitrary commands. A command-file mode would be simpler for synthetic or curated workloads.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions