mix malachi.loadtest (malachi v0.22.7)

View Source

Multi-core Elixir load generator for a running Malachi server.

One BEAM process per connection, so N connections use every scheduler (unlike a single-threaded client). Connects to an already-running server over the binary wire protocol and drives load.

mix malachi.loadtest --scenario produce --connections 512 --batch 10 --duration 10

Options

  • --scenario produce | fetch | mixed | stream | user | acl (default produce)

  • --connections concurrent connections (128)
  • --duration measured seconds (10), --warmup seconds excluded (2)
  • --batch records per produce (10), --record-size bytes (256), --keys cardinality (1000)
  • --pipeline in-flight requests per connection, produce only (1 = closed-loop)
  • --max records per fetch/push (100), --window stream credit (100)
  • --prepopulate records to seed before fetch/stream/mixed (10000 for those)
  • --topic (auto), --topics distinct topics to fan out over (1); N > 1 spreads load across data-plane shards
  • --host (127.0.0.1); accepts a comma-separated list for a cluster (connections round-robin across the hosts), --port (4040)
  • --connect-strategy bounded | stagger | all-at-once (default bounded): how the connections are opened, since each one pays a server-side credential verification and opening hundreds at once is an auth storm. bounded keeps at most --connect-concurrency (32) connects in flight; stagger delays connection i by i * --connect-stagger-ms (100); all-at-once opens everything together. Each pacing knob is only accepted with the strategy that reads it.

  • auth: --user (admin) --pass (admin123), or --token, or --tls/--cacert/--cert/--key
  • --tls verifies the server's certificate and hostname against --cacert, or against the system trust store when none is given. --insecure skips that verification: development only, since it makes the connection encrypted but unauthenticated and therefore open to interception.
  • --payload constant | json | random (default constant): what the record values are. constant is one repeated byte, as every published series so far; json is a seeded, event-like JSON document of exactly --record-size bytes (at least 149); random is seeded noise, the incompressible control. --payload-seed (1) picks the values and is only accepted with json or random. See Malachi.Loadtest.Payload.

  • --json emit the report as JSON
  • --measure-marker a path created (empty) the moment the measured window begins, after every connection has authenticated and the warmup has ended, so a harness can sample CPU over that window alone. Its directory must exist. Left out of the recorded command, since it is plumbing for the caller rather than part of the run.