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.
| Mode | Kind | What it measures |
|---|---|---|
spread | micro | Counter.incr/4 on one distinct key per worker |
hot | micro | Counter.incr/4 on a single shared key |
reserve | micro | AuroraMeter.reserve/3, admitting and denying |
with_quota | micro | AuroraMeter.with_quota/4 with a no-op callback |
cluster_2_sim | micro | gossip apply cost in one VM (not a cluster result) |
record | end_to_end | AuroraMeter.record/4, one event per call |
record_batch | end_to_end | AuroraMeter.record_batch/2 at 1, 10, 100 and 500 |
correct | end_to_end | AuroraMeter.correct/4 against pre-recorded originals |
replay | end_to_end | AuroraMeter.Events.Replay.run/1 over a seeded population |
credits_debit | end_to_end | AuroraMeter.Credits.debit/4 across distinct wallets |
credits_hot_wallet | end_to_end | the same debit against one shared wallet |
flush_1k, flush_10k, flush_100k | end_to_end | one Flusher.flush/0 with that many dirty keys |
db_delay | end_to_end | sustained load with a delay in front of every storage call |
db_recovery | end_to_end | sustained load across a real database outage, and the drain |
cluster_2, cluster_4 | end_to_end | convergence and overshoot on real peer nodes |
Options
--procs Nworkers, default 8--per Noperations per worker, default 500,000 micro and 2,000 end-to-end--warmup Ndiscarded operations per worker, default a tenth of--per--rounds Nrepetitions for the modes whose unit is a whole operation (replay,flush_*), default 5--duration MSthe load window fordb_delayanddb_recovery--json PATHwrite the record here--label TEXTa name for this run, default the mode--repo MODULEthe end-to-end repo--history/--no-historywhether day buckets are maintained--seed Nrecorded in the record; random when not given--sample-every Nmicro latency sampling rate, default 1,000--delay-us Nthe per-callback delay fordb_delay--broadcast-interval MS,--flush-interval MSoverride the mode's own defaults. The cluster overshoot guarantee is stated in terms of onebroadcast_interval, so being able to vary it is how that guarantee is measured rather than assumed--allow-any-databaserun against a database whose name does not end in_bench--quietprint 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.