pgbench accepts the following command-line initialization arguments: -F fillfactor Create the pgbench_accounts, pgbench_tellers and pgbench_branches tables with the given fillfactor. Default is 100. -i Required to invoke initialization mode. -s scale_factor Multiply the number of rows generated by the scale factor. For example, -s 100 will create 10,000,000 rows in the pgbench_accounts table. Default is 1.
pgbench accepts the following command-line benchmarking arguments: -c clients Number of clients simulated, that is, number of concurrent database sessions. Default is 1. -C Establish a new connection for each transaction, rather than doing it just once per client session. This is useful to measure the connection overhead. -d Print debugging output. -D varname=value Define a variable for use by a custom script (see below). Multiple -D options are allowed. -f filename Read transaction script from filename. See below for details. -N, -S, and -f are mutually exclusive. -j threads Number of worker threads within pgbench. Using more than one thread can be helpful on multi-CPU machines. The number of clients must be a multiple of the number of threads, since each thread is given the same number of client sessions to manage. Default is 1. -l Write the time taken by each transaction to a log file. See below for details. -M querymode Protocol to use for submitting queries to the server: simple: use simple query protocol. extended: use extended query protocol. prepared: use extended query protocol with prepared statements. The default is simple query protocol. (See Chapter 46 for more information.) -n Perform no vacuuming before running the test. This option is necessary if you are running a custom test scenario that does not include the standard tables pgbench_accounts, pgbench_branches, pgbench_history, and pgbench_tellers. -N Donot update pgbench_tellers and pgbench_branches. This will avoid update contention on these tables, but it makes the test case even less like TPC-B. -s scale_factor Report the specified scale factor in pgbench is output. With the built-in tests, this is not necessary; the correct scale factor will be detected by counting the number of rows in the pgbench_branches table. However, when testing custom benchmarks (-f option), the scale factor will be reported as 1 unless this option is used. -S Perform select-only transactions instead of TPC-B-like test. -t transactions Number of transactions each client runs. Default is 10. -T seconds Run the test for this many seconds, rather than a fixed number of transactions per client. -t and -T are mutually exclusive. -v Vacuum all four standard tables before running the test. With neither -n nor -v, pgbench will vacuum the pgbench_tellers and pgbench_branches tables, and will truncate pgbench_history.