A newer version of this documentation is available.

View Latest

cbworkloadgen

      +

      Generates random data and performs reads and writes

      SYNOPSIS

      cbworkloadgen [--node <host>] [--username <user>] [--password <password>]
                      [--bucket <bucket>] [--ssl] [--threads <num>]
                      [--ratio-sets <ratio>] [--max-items <num>] [--prefix <str>]
                      [--size <bytes>] [--json] [--low-compression] [--loop]
                      [--xattr] [--verbose] [--help]

      DESCRIPTION

      The cbworkloadgen tool is useful to test a Couchbase cluster as well as to generate test data sets. The tool is installed in the following locations:

      Operating system Location

      Linux

      /opt/couchbase/bin/

      Windows

      C:\Program Files\Couchbase\Server\bin\

      Mac OS X

      /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/

      Options

      -n,--node <host>

      Target node address in the form ip:port or hostname:port for example -n 127.0.0.1:8091. If non provided it will default to 127.0.0.1:8091.

      -u,--username <user>

      Specifies the username of the user executing the command. If you do not have a user account with permission to execute the command then it will fail with an unauthorized error.

      -p,--password <password>

      Specifies the password of the user executing the command. If you do not have a user account with permission to execute the command then it will fail with an unauthorized error.

      -b,--bucket <bucket>

      Specifies the bucket to operate on. If non provided it will use default.

      --ssl

      Use SSL for transferring and reading data.

      -t,--threads <num>

      Number of concurrent threads use to insert or get data. By default it will use 1.

      -r,--ratio-sets <ratio>

      The percentage of the workload that are writes; the remainder will be reads. By default it is set to 0.95.

      -i,--max-items<num>

      Number of inserted items. The default is 10000.

      --prefix <prefix>

      Prefixed to use for the document keys. The default is pymc.

      --s,--size <bytes>

      Minimum value size in bytes, it defaults to to bytes.

      --json

      When specified the program will insert json documents.

      --low-compression

      When specified the generated documents will be difficult to compress.

      --loop

      The process will loop forever until the user interrupts it.

      --xattr

      When specified the inserted documents will have extended attributes.

      -v,--verbose

      Verbose logging; more -Vs provide more verbosity.

      -h,--help

      Shows help message.

      Examples

      To generate workload on a given Couchbase Server use:

      $ cbworkloadgen -n 10.5.2.45:8091 -b my-bucket -u Administrator -p password

      This command will create 10000 binary documents with keys prefixed by pymc in the target bucket. The output of the command would look as follows:

      [####################] 100.0% (1111110/estimated 1111110 msgs)
      bucket: default, msgs transferred...
            :                total |       last |    per sec
      byte  :            111111000 |  111111000 |   636622.5
      done

      To generate a data set of one million JSON documents on a cluster use:

      $ cbworkloadgen -n 10.5.2.45:8091 -b my-bucket -u Administrator -p password \
       -i 1000000 -j -r 1

      By default the documents generated by the tool are very compressible which may not be ideal for some case scenarios to change this use the --low-compression flag as follows:

      $ cbworkloadgen -n 10.5.2.45:8091 -b my-bucket -u Administrator -p password \
       -i 1000000 -j -r 1 --low-compression -s 20480

      The command above will create documents with bodies of at least 20480 bytes (20Kb) that are hard to compress.