OS Manuals

/usr/bin/vtbench

All the binaries built by Vitess

From vitess-23-binaries 23.0.4-r5 (os), captured 2026-11-05 by running vtbench --help (exit 0). permalink

vtbench is a simple load testing client to compare workloads in Vitess across the various client/server protocols.

Usage:
  vtbench [flags]

Examples:
There are a number of command line options to control the behavior,
but as a basic example, the three supported client protocols are:

Mysql protocol to vtgate:
vtbench \
	--protocol mysql \
	--host vtgate-host.my.domain \
	--port 15306 \
	--user db_username \
	--db-credentials-file ./vtbench_db_creds.json \
	--db @replica \
	--sql "select * from loadtest_table where id=123456789" \
	--threads 10 \
	--count 10

GRPC to vtgate:
vtbench \
	--protocol grpc-vtgate \
	--host vtgate-host.my.domain \
	--port 15999 \
	--db @replica  \
	$VTTABLET_GRPC_ARGS \
	--sql "select * from loadtest_table where id=123456789" \
	--threads 10 \
	--count 10

GRPC to vttablet:
vtbench \
	--protocol grpc-vttablet \
	--host tablet-loadtest-00-80.my.domain \
	--port 15999 \
	--db loadtest/00-80@replica  \
	--sql "select * from loadtest_table where id=123456789" \
	--threads 10 \
	--count 10

Flags:
      --alsologtostderr                                             log to standard error as well as files
      --config-file string                                          Full path of the config file (with extension) to use. If set, --config-path, --config-type, and --config-name are ignored.
      --config-file-not-found-handling ConfigFileNotFoundHandling   Behavior when a config file is not found. (Options: error, exit, ignore, warn) (default warn)
      --config-name string                                          Name of the config file (without extension) to search for. (default "vtconfig")
      --config-path strings                                         Paths to search for config files in. (default [/tmp])
      --config-persistence-min-interval duration                    minimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done). (default 1s)
      --config-type string                                          Config file type (omit to infer config type from file extension).
      --count int                                                   Number of queries per thread (default 1000)
      --db string                                                   Database name to use when connecting / running the queries (e.g. @replica, keyspace, keyspace/shard etc)
      --db-credentials-file string                                  db credentials file; send SIGHUP to reload this file
      --db-credentials-server string                                db credentials server type ('file' - file implementation; 'vault' - HashiCorp Vault implementation) (default "file")
      --db-credentials-vault-addr string                            URL to Vault server
      --db-credentials-vault-path string                            Vault path to credentials JSON blob, e.g.: secret/data/prod/dbcreds
      --db-credentials-vault-role-mountpoint string                 Vault AppRole mountpoint; can also be passed using VAULT_MOUNTPOINT environment variable (default "approle")
      --db-credentials-vault-role-secretidfile string               Path to file containing Vault AppRole secret_id; can also be passed using VAULT_SECRETID environment variable
      --db-credentials-vault-roleid string                          Vault AppRole id; can also be passed using VAULT_ROLEID environment variable
      --db-credentials-vault-timeout duration                       Timeout for vault API operations (default 10s)
      --db-credentials-vault-tls-ca string                          Path to CA PEM for validating Vault server certificate
      --db-credentials-vault-tokenfile string                       Path to file containing Vault auth token; token can also be passed using VAULT_TOKEN environment variable
      --db-credentials-vault-ttl duration                           How long to cache DB credentials from the Vault server (default 30m0s)
      --deadline duration                                           Maximum duration for the test run (default 5 minutes) (default 5m0s)
      --grpc-auth-static-client-creds string                        When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.
      --grpc-compression string                                     Which protocol to use for compressing gRPC. Default: nothing. Supported: snappy
      --grpc-dial-concurrency-limit int                             Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000. (default 1024)
      --grpc-enable-tracing                                         Enable gRPC tracing.
      --grpc-initial-conn-window-size int                           gRPC initial connection window size
      --grpc-initial-window-size int                                gRPC initial window size
      --grpc-keepalive-time duration                                After a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive. (default 10s)
      --grpc-keepalive-timeout duration                             After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. (default 10s)
      --grpc-max-message-size int                                   Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
      --grpc-prometheus                                             Enable gRPC monitoring with Prometheus.
  -h, --help                                                        help for vtbench
      --host string                                                 VTGate host(s) in the form 'host1,host2,...'
      --keep-logs duration                                          keep logs for this long (using ctime) (zero to keep forever)
      --keep-logs-by-mtime duration                                 keep logs for this long (using mtime) (zero to keep forever)
      --log-err-stacks                                              log stack traces for errors
      --log-rotate-max-size uint                                    size in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)
      --log_backtrace_at traceLocations                             when logging hits line file:N, emit a stack trace
      --log_dir string                                              If non-empty, write log files in this directory
      --logtostderr                                                 log to standard error instead of files
      --mysql-server-version string                                 MySQL server version to advertise. (default "8.4.6-Vitess")
      --port int                                                    VTGate port
      --pprof strings                                               enable profiling
      --pprof-http                                                  enable pprof http endpoints
      --protocol string                                             Client protocol, either mysql (default), grpc-vtgate, or grpc-vttablet (default "mysql")
      --purge-logs-interval duration                                how often try to remove old logs (default 1h0m0s)
      --security-policy string                                      the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
      --sql string                                                  SQL statement to execute
      --sql-max-length-errors int                                   truncate queries in error logs to the given length (default unlimited)
      --sql-max-length-ui int                                       truncate queries in debug UIs to the given length (default 512) (default 512)
      --stderrthreshold severityFlag                                logs at or above this threshold go to stderr (default 1)
      --tablet-grpc-ca string                                       the server ca to use to validate servers when connecting
      --tablet-grpc-cert string                                     the cert to use to connect
      --tablet-grpc-crl string                                      the server crl to use to validate server certificates when connecting
      --tablet-grpc-key string                                      the key to use to connect
      --tablet-grpc-server-name string                              the server name to use to validate server certificate
      --threads int                                                 Number of parallel threads to run (default 2)
      --unix-socket string                                          VTGate unix socket
      --user string                                                 Username to connect using mysql (password comes from the db-credentials-file)
      --v Level                                                     log level for V logs
  -v, --version                                                     print binary version
      --vmodule vModuleFlag                                         comma-separated list of pattern=N settings for file-filtered logging
      --vtgate-grpc-ca string                                       the server ca to use to validate servers when connecting
      --vtgate-grpc-cert string                                     the cert to use to connect
      --vtgate-grpc-crl string                                      the server crl to use to validate server certificates when connecting
      --vtgate-grpc-fail-fast                                       whether to enable grpc fail fast when connecting
      --vtgate-grpc-key string                                      the key to use to connect
      --vtgate-grpc-server-name string                              the server name to use to validate server certificate
Options (68)
OptionDescriptionSource
--count 10help
--db @replica\help
--alsologtostderrlog to standard error as well as fileshelp
--config-file stringFull path of the config file (with extension) to use.help
--config-file-not-found-handling ConfigFileNotFoundHandlingBehavior when a config file is not found.help
--config-name stringName of the config file (without extension) to search for.help
--config-path stringsPaths to search for config files in.help
--config-persistence-min-interval durationminimum interval between persisting dynamic config changes back to disk (if no change has occurred, nothing is done).help
--config-type stringConfig file type (omit to infer config type from file extension).help
--db-credentials-file stringdb credentials file;help
--db-credentials-server stringdb credentials server type ('file' - file implementation;help
--db-credentials-vault-addr stringURL to Vault serverhelp
--db-credentials-vault-path stringVault path to credentials JSON blob, e.g.: secret/data/prod/dbcredshelp
--db-credentials-vault-role-mountpoint stringVault AppRole mountpoint;help
--db-credentials-vault-role-secretidfile stringPath to file containing Vault AppRole secret_id;help
--db-credentials-vault-roleid stringVault AppRole id;help
--db-credentials-vault-timeout durationTimeout for vault API operations (default 10s)help
--db-credentials-vault-tls-ca stringPath to CA PEM for validating Vault server certificatehelp
--db-credentials-vault-tokenfile stringPath to file containing Vault auth token;help
--db-credentials-vault-ttl durationHow long to cache DB credentials from the Vault server (default 30m0s)help
--deadline durationMaximum duration for the test run (default 5 minutes) (default 5m0s)help
--grpc-auth-static-client-creds stringWhen using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.help
--grpc-compression stringWhich protocol to use for compressing gRPC.help
--grpc-dial-concurrency-limit intMaximum concurrency of grpc dial operations.help
--grpc-enable-tracingEnable gRPC tracing.help
--grpc-initial-conn-window-size intgRPC initial connection window sizehelp
--grpc-initial-window-size intgRPC initial window sizehelp
--grpc-keepalive-time durationAfter a duration of this time, if the client doesn't see any activity, it pings the server to see if the transport is still alive.help
--grpc-keepalive-timeout durationAfter having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.help
--grpc-max-message-size intMaximum allowed RPC message size.help
--grpc-prometheusEnable gRPC monitoring with Prometheus.help
-h, --helphelp for vtbenchhelp
--host stringVTGate host(s) in the form 'host1,host2,...'help
--keep-logs durationkeep logs for this long (using ctime) (zero to keep forever)help
--keep-logs-by-mtime durationkeep logs for this long (using mtime) (zero to keep forever)help
--log-err-stackslog stack traces for errorshelp
--log-rotate-max-size uintsize in bytes at which logs are rotated (glog.MaxSize) (default 1887436800)help
--log_backtrace_at traceLocationswhen logging hits line file:N, emit a stack tracehelp
--log_dir stringIf non-empty, write log files in this directoryhelp
--logtostderrlog to standard error instead of fileshelp
--mysql-server-version stringMySQL server version to advertise.help
--port intVTGate porthelp
--pprof stringsenable profilinghelp
--pprof-httpenable pprof http endpointshelp
--protocol stringClient protocol, either mysql (default), grpc-vtgate, or grpc-vttablet (default "mysql")help
--purge-logs-interval durationhow often try to remove old logs (default 1h0m0s)help
--security-policy stringthe name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)help
--sql stringSQL statement to executehelp
--sql-max-length-errors inttruncate queries in error logs to the given length (default unlimited)help
--sql-max-length-ui inttruncate queries in debug UIs to the given length (default 512) (default 512)help
--stderrthreshold severityFlaglogs at or above this threshold go to stderr (default 1)help
--tablet-grpc-ca stringthe server ca to use to validate servers when connectinghelp
--tablet-grpc-cert stringthe cert to use to connecthelp
--tablet-grpc-crl stringthe server crl to use to validate server certificates when connectinghelp
--tablet-grpc-key stringthe key to use to connecthelp
--tablet-grpc-server-name stringthe server name to use to validate server certificatehelp
--threads intNumber of parallel threads to run (default 2)help
--unix-socket stringVTGate unix sockethelp
--user stringUsername to connect using mysql (password comes from the db-credentials-file)help
--v Levellog level for V logshelp
-v, --versionprint binary versionhelp
--vmodule vModuleFlagcomma-separated list of pattern=N settings for file-filtered logginghelp
--vtgate-grpc-ca stringthe server ca to use to validate servers when connectinghelp
--vtgate-grpc-cert stringthe cert to use to connecthelp
--vtgate-grpc-crl stringthe server crl to use to validate server certificates when connectinghelp
--vtgate-grpc-fail-fastwhether to enable grpc fail fast when connectinghelp
--vtgate-grpc-key stringthe key to use to connecthelp
--vtgate-grpc-server-name stringthe server name to use to validate server certificatehelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.