Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command line

pgmeter [connection options] <command> [options]

Commands: init, run, spec list, spec new. pgmeter --help and pgmeter <command> --help print the same options with their defaults.

Connection options

Global, placed before the command. Each has the environment variable the PostgreSQL tools use; see Connecting to PostgreSQL.

OptionEnvironment variableDefaultDescription
-H, --host <HOSTNAME>PGHOSTlocalhostHost name or socket directory
-p, --port <PORT>PGPORT5432Port
-U, --username <USERNAME>PGUSERcurrent OS userDatabase user
-d, --dbname <DBNAME>PGDATABASEcurrent OS userDatabase
--sslmode <MODE>PGSSLMODEpreferdisable, prefer, require, verify-ca or verify-full
-h, --helpPrint help
-V, --versionPrint the version

The password comes from PGPASSWORD, or from the password file (PGPASSFILE, default ~/.pgpass) when it is not set.

init

pgmeter [connection options] init --spec <DIR|FILE> [options]

Drops and recreates the tables the spec declares, loads the data, then adds keys and indexes, vacuums and checkpoints. See Initializing a benchmark.

OptionDefaultDescription
--spec <FILE>requiredA benchmark directory containing spec.yaml, or a single spec file
-s, --scalefactor <NUM>1Number of scale units to load
-j, --jobs <NUM>1Parallel loader connections
--no-fkeyoffSkip foreign-key creation
--post-create-table <FILE>noneSQL file run after the tables are created
--seed <NUM>noneSeed of the data generators: the same seed and scale factor load the same data, whatever -j
-q, --quietoffNo progress output

run

pgmeter [connection options] run --spec <DIR|FILE> [options]

Drives the spec’s transaction mix. See Running a benchmark.

OptionDefaultDescription
--spec <FILE>requiredThe spec init was given
-c, --client <NUM>1Concurrent clients
-T, --time <NUM>1Measured duration in seconds
-r, --rampup <NUM>0Ramp-up in seconds, excluded from the statistics
-P, --progress <NUM>0Print a progress: line every NUM seconds when stderr is not a terminal (rate and latency of a timed run, transactions done and in flight of a --once run); 0 disables
-j, --threads <NUM>0Worker threads of the async engine (simple-mode specs); 0 is half the CPUs, at most one per client
--onceoffEach client runs every transaction of the spec once, in its own random order, then stops (a TPC-H/DS-style query stream); cannot be combined with --time
--seed <NUM>noneSeed of the clients’ random draws: the same seed, spec and client count run the same transactions with the same parameters, whatever the engine or --threads
--format <FMT>tabletable, json or csv
-q, --quietoffNo progress output; only the result data on stdout

spec list

pgmeter spec list

Prints the bundled workloads with their title and description.

spec new

pgmeter spec new <BENCHMARK> [-o <DIR>] [--force]

Writes an editable copy of a bundled workload: its spec.yaml and, when it has any, its scripts/ folder.

Argument or optionDefaultDescription
<BENCHMARK>requiredA name from spec list: pgm-b, pgm-c, pgm-c-client, pgm-h, pgm-ds, pgm-iot or custom-simple
-o, --output <DIR>.Directory the benchmark folder is written into
--forceoffOverwrite the destination if it exists

Exit status

StatusMeaning
0Success, including a run ended early with one Ctrl-C
1Any error: bad arguments, unreadable or invalid spec, connection failure, a client that could not start, an init step that failed
130A second Ctrl-C during a run, which aborts immediately

Errors are printed on stderr as error: <message>, with the server’s detail when there is one.