Skip to main content

Benchmark-ZrStore

Runs a concurrent read/write benchmark against a Zaris store and reports throughput, total operations, and failures. The read/write mix is set by the selected profile.

Syntax

Benchmark-ZrStore -StoreName <string> -Profile <string> [-DurationSec <int>] [-Concurrency <int>] [-ObjectSizeBytes <int>] [-ConnectionString <string>] [-Endpoints <string[]>] [-TimeoutSec <int>]

Description

Benchmark-ZrStore drives concurrent read/write traffic against the named Zaris store for a fixed duration and reports operations per second, total operations, and failure count. The read/write ratio is chosen by -Profile. If a store is already connected, its name must match -StoreName; otherwise the command fails with a store-mismatch error.

The cmdlet requires an active connection (Connect-ZrStore) or a one-shot independent connection supplied through -Endpoints. The run stops when -DurationSec elapses or on Ctrl+C; no result is written on cancellation.

Parameters

ParameterTypeRequiredDescription
-StoreNameStringYesThe name of the store to benchmark. Must match the connected store when one is active.
-ProfileStringYesThe workload mix to generate. ValidateSet: ReadHeavy (~10% writes), WriteHeavy (~90% writes), Mixed (~50% writes).
-DurationSecInt32NoHow long to run the benchmark, in seconds. Range 1–3600. Default 60.
-ConcurrencyInt32NoThe number of concurrent worker tasks issuing operations. Range 1–1024. Default 16.
-ObjectSizeBytesInt32NoThe size, in bytes, of each value written during the benchmark. Range 32–1048576. Default 100.
-ConnectionStringStringNoConnect via a Zaris connection string, e.g. zaris://host:7861/store; an alternative to -StoreName + -Endpoints for a one-shot connection. Ignored when a Connect-ZrStore session is active.
-EndpointsString[]NoOne or more store node endpoints (host:port) for a one-shot independent connection. Only the first endpoint is used as the seed. Ignored when a Connect-ZrStore session is active.
-TimeoutSecInt32NoConnection timeout, in seconds, for an independent connection. Range 1–120. Default 5.

Returns an object with StoreName, Profile, DurationSecRequested, DurationSecActual, Concurrency, ObjectSizeBytes, TotalOperations, OpsPerSecond, and Failures.

Examples

Run a 30-second mixed read/write benchmark using 32 concurrent workers:

Benchmark-ZrStore -StoreName "orders" -Profile Mixed -DurationSec 30 -Concurrency 32

Run a read-heavy benchmark:

Benchmark-ZrStore -StoreName "orders" -Profile ReadHeavy -Concurrency 64

Run a write-heavy benchmark with larger 1 KB values:

Benchmark-ZrStore -StoreName "orders" -Profile WriteHeavy -ObjectSizeBytes 1024