github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/docs/user_docs/cli/kbcli_bench_pgbench.md (about)

     1  ---
     2  title: kbcli bench pgbench
     3  ---
     4  
     5  Run pgbench against a PostgreSQL cluster
     6  
     7  ```
     8  kbcli bench pgbench [Step] [BenchmarkName] [flags]
     9  ```
    10  
    11  ### Examples
    12  
    13  ```
    14    # pgbench run on a cluster, that will exec for all steps, cleanup, prepare and run
    15    kbcli bench pgbench mytest --cluster pgcluster --database postgres --user xxx --password xxx
    16    
    17    # pgbench run on a cluster with cleanup, only cleanup by deleting the testdata
    18    kbcli bench pgbench cleanup mytest --cluster pgcluster --database postgres --user xxx --password xxx
    19    
    20    # pgbench run on a cluster with prepare, just prepare by creating the testdata
    21    kbcli bench pgbench prepare mytest --cluster pgcluster --database postgres --user xxx --password xxx
    22    
    23    # pgbench run on a cluster with run, just run by running the test
    24    kbcli bench pgbench run mytest --cluster pgcluster --database postgres --user xxx --password xxx
    25    
    26    # pgbench run on a cluster with  thread and  client counts
    27    kbcli bench sysbench mytest --cluster pgcluster --user xxx --password xxx --database xxx --clients 5 --threads 5
    28    
    29    # pgbench run on a cluster with specified transactions
    30    kbcli bench pgbench mytest --cluster pgcluster --database postgres --user xxx --password xxx --transactions 1000
    31    
    32    # pgbench run on a cluster with specified seconds
    33    kbcli bench pgbench mytest --cluster pgcluster --database postgres --user xxx --password xxx --duration 60
    34    
    35    # pgbench run on a cluster with 'select' only
    36    kbcli bench pgbench mytest --cluster pgcluster --database postgres --user xxx --password xxx --select
    37  ```
    38  
    39  ### Options
    40  
    41  ```
    42        --clients ints          The number of clients to use for pgbench (default [1])
    43        --cluster string        the cluster of database
    44        --database string       database name
    45        --driver string         the driver of database
    46        --duration int          The seconds to run pgbench for (default 60)
    47        --extra-args strings    extra arguments for benchmark
    48    -h, --help                  help for pgbench
    49        --host string           the host of database
    50        --password string       the password of database
    51        --port int              the port of database
    52        --scale int             The scale factor to use for pgbench (default 1)
    53        --select                Run pgbench with select only
    54        --threads int           The number of threads to use for pgbench (default 1)
    55        --tolerations strings   Tolerations for benchmark, such as '"dev=true:NoSchedule,large=true:NoSchedule"'
    56        --transactions int      The number of transactions to run for pgbench
    57        --user string           the user of database
    58  ```
    59  
    60  ### Options inherited from parent commands
    61  
    62  ```
    63        --as string                      Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
    64        --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
    65        --as-uid string                  UID to impersonate for the operation.
    66        --cache-dir string               Default cache directory (default "$HOME/.kube/cache")
    67        --certificate-authority string   Path to a cert file for the certificate authority
    68        --client-certificate string      Path to a client certificate file for TLS
    69        --client-key string              Path to a client key file for TLS
    70        --context string                 The name of the kubeconfig context to use
    71        --disable-compression            If true, opt-out of response compression for all requests to the server
    72        --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
    73        --kubeconfig string              Path to the kubeconfig file to use for CLI requests.
    74        --match-server-version           Require server version to match client version
    75    -n, --namespace string               If present, the namespace scope for this CLI request
    76        --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
    77    -s, --server string                  The address and port of the Kubernetes API server
    78        --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
    79        --token string                   Bearer token for authentication to the API server
    80  ```
    81  
    82  ### SEE ALSO
    83  
    84  * [kbcli bench](kbcli_bench.md)	 - Run a benchmark.
    85  
    86  #### Go Back to [CLI Overview](cli.md) Homepage.
    87