skip to content

Before a launch, a team wants to use a redis-benchmark result as its Redis capacity number; what may that result decide, and who signs off on capacity?

level: principalimportance: should knowfreq 20%

answer

  1. good for comparing, weak for predicting
  2. same harness, one thing changed
  3. how far below the ceiling?
  4. conditions written beside the number
  5. whoever carries the pager signs

basics

~20 s

A redis-benchmark result can decide comparisons on one harness and rule out Redis as an obvious limit, but it is not production capacity. The lead whose team runs the instance signs a statement of its conditions and expiry.

solid answer

~50 s

I'd let a `redis-benchmark` result decide relative questions: same harness, one change, such as a new version, `io-threads` or a persistence setting. I'd also use it as a coarse check. If the launch target is a tiny fraction of a figure measured from an application host, with flags taken from production, Redis probably isn't the first limit. It can't decide how much real traffic the instance sustains, because it doesn't carry your command mix, large keys or background saves; near the limit, that needs a test shaped like production. Sign-off belongs to the lead whose team carries the pager for that instance, not whoever ran the tool. They sign a statement: the number, its flags, the network path, the version and persistence settings, the margin, and what makes it expire. Reasonable teams set different margins, based on what an outage would cost.

code

bash · 4 lines
bash
redis-benchmark -h 10.0.1.5 -t get,set -c 200 -n 5000000 -d 512 -r 1000000 &
sleep 10
redis-cli -h 10.0.1.5 BGSAVE
wait

go deeper

for a junior

Recall that a benchmark number depends on how it was run, and that it should be reported alongside the flags and the machine that produced it.

for a middle

Explain why comparisons on one harness are more trustworthy than absolute figures, and which production readings can supply the flags.

for a senior

Build the run from production readings, say what it left out, and report it as a statement of conditions rather than as a single number.

for a principal

Decide how much evidence a launch needs given its distance from the ceiling and the cost of failure. Name who signs, what the statement contains and what events expire it.

## The decision behind the question A benchmark produces a number, and a launch needs a judgment. The two get confused because the number looks so authoritative. A lead has to decide what the number is allowed to mean and who stands behind the conclusion. There is no single right answer: it depends on how close you are to the limit and what an outage would cost. ## What a redis-benchmark result can decide The Redis docs call comparing apples with apples the golden rule of a useful benchmark, and name the fair cases: different Redis versions on the same workload, or one version with different options. That points at the tool's real strengths: - **Regression checks**: is a new release slower on our harness? - **Setting comparisons**: what does `io-threads`, TLS or an AOF fsync policy cost on this hardware? - **Hardware comparisons**: which instance class gives more for its cost, with the same flags? - **A coarse lower bound**: is Redis anywhere near being the first limit? All of these use the result as a **difference** or an **order of magnitude**. ## What it should not decide on its own - **"This instance sustains N requests per second in production."** A synthetic run has one command type per test, a uniform value size, and no competition from your slowest commands. Real keys, values and hot spots are all missing. - **"Latency at launch will be X."** The tool's latency does not include your client library's pool, your retries or your service's queues. - **"Ten nodes give ten times this."** Keys and traffic rarely spread evenly across nodes, so a per-node figure does not simply multiply. The docs also warn that a figure taken while a `BGSAVE` runs is closer to a worst case than a best case. That is worth doing on purpose, because a run with no save in it says nothing about that moment. ## Building inputs that deserve some trust A benchmark's flags can come from production rather than from guesses, and this is where the other tools feed in: 1. **Command mix**: the difference between two `INFO commandstats` snapshots gives `-t` and the proportions. 2. **Concurrency**: `connected_clients` gives a starting `-c`. 3. **Value sizes and keyspace**: `INFO keysizes` shows the distribution, and `keyspace` the key count, for `-d` and `-r`. 4. **Pipelining**: what the application really does gives `-P`. 5. **Environment**: a separate client host on the same network path, the same persistence settings and a matching instance class. ## A workable decision rule The useful question is how far the target sits below the measured ceiling. The thresholds below are an example of the shape, which each team should set for itself: | Target against measured figure | What the benchmark can support | What else is needed | |---|---|---| | A small fraction, such as under 10% | "Redis is not our first limit" | Normal monitoring after launch | | A meaningful share, such as 10% to 50% | A provisional plan | A test using production's command mix | | Close to it | Nothing on its own | A production-shaped test, or more capacity | The tradeoff is real on both sides. A faithful test costs engineering time and may delay a launch; skipping it risks finding the limit in front of users. For a small target on a cache that can fail open, a one-hour benchmark can be enough. For a primary data store on a launch day that cannot move, it will not be. ## Who signs off The person who ran the tool can vouch for the run, but not for the risk. A workable split: - **The engineer** owns the method and reports the figures with their conditions. - **The lead of the team that operates the instance**, who carries the pager, signs the capacity statement. - **The service owner whose launch depends on it** states the target traffic and accepts the residual risk if the margin is thin. When one team owns both the service and the instance, this collapses to one person, and it should still be written down. ## What the statement contains - The figure, with exact flags and date. - Redis version, persistence settings, TLS and instance class. - The network path and where the client ran. - The target traffic and the resulting margin. - **Expiry triggers**: a Redis upgrade, a persistence or TLS change, a new instance class, or a shift in the command mix. A number with those attached can be challenged and renewed. A number without them turns into folklore.

  • What would make you discard a capacity statement that was signed six months ago?
    A change to anything it depends on, rather than its age alone: a Redis upgrade, a change to persistence or TLS, a new instance class, or a shift in the command mix seen in `INFO commandstats`. That is why triggers beat a calendar date. Without any of those, it may still hold, though I'd rerun the same benchmark cheaply to confirm.
  • A manager quotes a blog post saying Redis does a million operations per second. How do you respond?
    Ask which flags, value size, pipeline depth, network path and hardware produced it, since the Redis docs show pipelining alone moving a run past a million per second. Without those, it can't be compared to anything of ours. I'd offer our own run, with its conditions attached, in place of that figure.

  • The redis-benchmark peak figure is the production capacity of that instance.
  • Whoever ran the benchmark is the right person to sign off on launch capacity.
  • A capacity number stays valid until the next calendar review, whatever else changes.
  • Multiplying a per-node benchmark figure by the node count gives the capacity of a cluster.
  • Because redis-benchmark is synthetic, its results are useless for any decision.