mix aurora_meter.bench (Aurora Meter v1.0.0)

View Source

Measures Aurora Meter and writes a machine-readable record of what it measured.

mix aurora_meter.bench <mode> [options]

Modes

kind is the column to read first. A micro mode isolates an in-memory path with stubbed or absent persistence; an end-to-end mode reaches Postgres through the real adapter on every write. The two differ by orders of magnitude, so a figure quoted without its kind says very little.

ModeKindWhat it measures
spreadmicroCounter.incr/4 on one distinct key per worker
hotmicroCounter.incr/4 on a single shared key
reservemicroAuroraMeter.reserve/3, admitting and denying
with_quotamicroAuroraMeter.with_quota/4 with a no-op callback
cluster_2_simmicrogossip apply cost in one VM (not a cluster result)
recordend_to_endAuroraMeter.record/4, one event per call
record_batchend_to_endAuroraMeter.record_batch/2 at 1, 10, 100 and 500
correctend_to_endAuroraMeter.correct/4 against pre-recorded originals
replayend_to_endAuroraMeter.Events.Replay.run/1 over a seeded population
credits_debitend_to_endAuroraMeter.Credits.debit/4 across distinct wallets
credits_hot_walletend_to_endthe same debit against one shared wallet
flush_1k, flush_10k, flush_100kend_to_endone Flusher.flush/0 with that many dirty keys
db_delayend_to_endsustained load with a delay in front of every storage call
db_recoveryend_to_endsustained load across a real database outage, and the drain
cluster_2, cluster_4end_to_endconvergence and overshoot on real peer nodes

Options

  • --procs N workers, default 8
  • --per N operations per worker, default 500,000 micro and 2,000 end-to-end
  • --warmup N discarded operations per worker, default a tenth of --per
  • --rounds N repetitions for the modes whose unit is a whole operation (replay, flush_*), default 5
  • --duration MS the load window for db_delay and db_recovery
  • --json PATH write the record here
  • --label TEXT a name for this run, default the mode
  • --repo MODULE the end-to-end repo
  • --history / --no-history whether day buckets are maintained
  • --seed N recorded in the record; random when not given
  • --sample-every N micro latency sampling rate, default 1,000
  • --delay-us N the per-callback delay for db_delay
  • --broadcast-interval MS, --flush-interval MS override the mode's own defaults. The cluster overshoot guarantee is stated in terms of one broadcast_interval, so being able to vary it is how that guarantee is measured rather than assumed
  • --allow-any-database run against a database whose name does not end in _bench
  • --quiet print nothing but the verdict

The database

End-to-end modes run against their own database, whose name must end in _bench, with an ordinary pooled connection. Set AURORA_BENCH=1 so this repository's test repo resolves to aurora_meter_bench, and create it with mix bench.setup. A repo configured with Ecto.Adapters.SQL.Sandbox is refused outright: the sandbox serialises every worker onto one owned connection, so the run would measure the sandbox.

The deprecated positional form

mix aurora_meter.bench 8 500000 still runs, as spread --procs 8 --per 500000, and prints a deprecation notice. It is removed in 2.0.