tursodatabase/turso · error

throughput requires --state warm

Error message

throughput requires --state warm

What it means

Throughput mode requires the warm query state: it measures steady-state queries per second and cold caches or first-connection effects would skew results. ensure! at perf/fts/src/main.rs:97 rejects any --state other than warm when --benchmark throughput is selected.

Solutions

  1. Add or change to --state warm when using --benchmark throughput
  2. Drop the explicit --state flag only if warm is the default (otherwise set it explicitly)
  3. Run search mode instead if first-query/cold behavior is what you want to measure

Example fix

// before
fts-bench --benchmark throughput --state first --seconds 10
// after
fts-bench --benchmark throughput --state warm --seconds 10
Defensive patterns

Strategy: validation

Validate before calling

if benchmark == Throughput && state != Warm { panic!("--benchmark throughput requires --state warm"); }

Prevention

When it happens

Trigger: Running `fts-bench --benchmark throughput --state first` (or any non-warm state). The ensure! fires whenever matches!(args.state, QueryState::Warm) is false in the Throughput branch.

Common situations: Leaving a --state first flag from a latency run while switching the benchmark to throughput; assuming throughput mode supports cold-start measurement.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of tursodatabase/turso@8d4a589f8d (2026-09-20). Data as JSON: /api/errors/7fb6255d02e19d23. Report an issue: GitHub.

Appendix: source

Thrown at perf/fts/src/main.rs:97

                } else {
                    10_000
                });
            ensure!(
                queries >= args.connections,
                "need at least one query per connection"
            );
            ensure!(
                !matches!(args.state, QueryState::First) || queries == args.connections,
                "first-query latency requires one query per connection"
            );
            (queries, 0.0)
        }
        Benchmark::Throughput => {
            ensure!(
                args.queries.is_none(),
                "--queries requires --benchmark search"
            );
            ensure!(
                matches!(args.state, QueryState::Warm),
                "throughput requires --state warm"
            );
            let seconds = args.seconds.unwrap_or(5.0);
            ensure!(
                seconds.is_finite() && seconds > 0.0,
                "seconds must be finite and positive"
            );
            (0, seconds)
        }
    };
    #[cfg(all(feature = "flamegraph", any(target_os = "linux", target_os = "macos")))]
    let profiled = args.flamegraph.is_some();
    #[cfg(not(all(feature = "flamegraph", any(target_os = "linux", target_os = "macos"))))]
    let profiled = false;
    #[cfg(all(feature = "flamegraph", any(target_os = "linux", target_os = "macos")))]
    if let Some(directory) = &args.flamegraph {
        std::fs::create_dir(directory)?;

View on GitHub (pinned to 8d4a589f8d)