.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "CBC\-PILLOWFIGHT" "1" "April 2019" "" "" . .SH "NAME" \fBcbc\-pillowfight\fR \- Stress Test for Couchbase Client and Cluster . .SH "SYNOPSIS" \fBcbc\-pillowfight\fR [\fIOPTIONS\fR] . .SH "DESCRIPTION" \fBcbc\-pillowfight\fR creates a specified number of threads each looping and performing get and set operations within the cluster\. . .P The stress test operates in the following order . .IP "1." 4 It will pre\-load the items in the cluster (set by the \fB\-\-num\-items\fR option) . .IP "2." 4 Once the items are all loaded into the cluster, it will access all the items (within the \fB\-\-num\-items\fR) specification, using a combination of storage and retrieval operations (the proportion of retrieval and storage operations are controlled via the \fB\-\-set\-pct\fR option)\. . .IP "3." 4 Operations are scheduled in \fIbatches\fR\. The batches represent a single pipeline (or network buffer) which is filled with a certain amount of operations (see the \fB\-\-batch\-size\fR option)\. These batch sizes are then sent over to the cluster and the requests are serviced by it\. . .IP "" 0 . .SS "Tuning" Getting the right benchmark numbers highly depends on the type of environment the client is being run in\. The following provides some information about specific settings which may make \fBpillowfight\fR generate more operations\. . .IP "\(bu" 4 Increasing the batch size will typically speed up operations, but increasing the batch size too much will actually slow it down\. Additionally, very high batch sizes will cause high memory usage\. . .IP "\(bu" 4 Adding additional threads will create additional client objects and connections, potentially increasing performance\. Adding too many threads will cause local and network resource congestion\. . .IP "\(bu" 4 Decreasing the item sizes (the \fB\-\-min\-size\fR and \fB\-\-max\-size\fR options) will always yield higher performance in terms of operationd\-per\-second\. . .IP "\(bu" 4 Limiting the working set (i\.e\. \fB\-\-num\-items\fR) will decrease the working set within the cluster, thereby increasing the chance that a given item will be inside the server\'s CPU cache (which is extremely fast), rather than in main memory (slower), or disk (much slower) . .IP "" 0 . .P The benchmark tool sets up SIGQUIT (CTRL\-/) handler and dumps useful diagnostics and metrics to STDERR on this signal\. . .SH "OPTIONS" Options may be read either from the command line, or from a configuration file (see cbcrc(4)): . .P The following options control workload generation: . .TP \fB\-B\fR, \fB\-\-batch\-size\fR=\fIBATCHSIZE\fR This controls how many commands are scheduled per cycles\. To simulate one operation at a time, set this value to 1\. . .TP \fB\-I\fR, \fB\-\-num\-items\fR=\fINUMITEMS\fR Set the \fItotal\fR number of items the workload will access within the cluster\. This will also determine the working set size at the server and may affect disk latencies if set to a high number\. . .TP \fB\-p\fR, \fB\-\-key\-prefix\fR=\fIPREFIX\fR Set the prefix to prepend to all keys in the cluster\. Useful if you do not wish the items to conflict with existing data\. . .TP \fB\-t\fR, \fB\-\-num\-threads\fR=\fINTHREADS\fR Set the number of threads (and thus the number of client instances) to run concurrently\. Each thread is assigned its own client object\. . .TP \fB\-r\fR, \fB\-\-set\-pct\fR=\fIPERCENTAGE\fR The percentage of operations which should be mutations\. A value of 100 means only mutations while a value of 0 means only retrievals\. . .TP \fB\-n\fR, \fB\-\-no\-population\fR By default \fBcbc\-pillowfight\fR will load all the items (see \fB\-\-num\-items\fR) into the cluster and then begin performing the normal workload\. Specifying this option bypasses this stage\. Useful if the items have already been loaded in a previous run\. . .TP \fB\-\-populate\-only\fR Stop after population\. Useful to populate buckets with large amounts of data\. . .TP \fB\-m\fR, \fB\-\-min\-size\fR=\fIMINSIZE\fR: . .TP \fB\-M\fR, \fB\-\-max\-size\fR=\fIMAXSIZE\fR Specify the minimum and maximum value sizes to be stored into the cluster\. This is typically a range, in which case each value generated will be between \fB\-\-min\-size\fR and \fB\-\-max\-size\fR bytes\. . .TP \fB\-E\fR, \fB\-\-pause\-at\-end\fR When the workload completes, do not exit immediately, but wait for user input\. This is helpful for analyzing open socket connections and state\. . .TP \fB\-c\fR, \fB\-\-num\-cycles\fR Specify the number of times the workload should cycle\. During each cycle an amount of \fB\-\-batch\-size\fR operations are executed\. Setting this to \fB\-1\fR will cause the workload to run infinitely\. . .TP \fB\-\-sequential\fR Specify that the access pattern should be done in a sequential manner\. This is useful for bulk\-loading many documents in a single server\. . .TP \fB\-\-start\-at\fR This specifies the starting offset for the items\. The items by default are generated with the key prefix (\fB\-\-key\-prefix\fR) up to the number of items (\fB\-\-num\-items\fR)\. The \fB\-\-start\-at\fR value will increase the lower limit of the items\. This is useful to resume a previously cancelled load operation\. . .TP \fB\-T\fR, \fB\-\-timings\fR Enabled timing recorded\. Timing histogram will be dumped to STDERR on SIGQUIT (CTRL\-/)\. When specified second time, it will dump a histogram of command timings and latencies to the screen every second\. . .TP \fB\-e\fR, \fB\-\-expiry\fR=\fISECONDS\fR Set the expiration time on the document for \fISECONDS\fR when performing each operation\. Note that setting this too low may cause not\-found errors to appear on the screen\. . .TP \fB\-U\fR, \fB\-\-spec\fR=\fISPEC\fR A string describing the cluster to connect to\. The string is in a URI\-like syntax, and may also contain other options\. See the \fIEXAMPLES\fR section for information\. Typically such a URI will look like \fBcouchbase://host1,host2,host3/bucket\fR\. . .IP The default for this option is \fBcouchbase://localhost/default\fR . .TP \fB\-u\fR, \fB\-\-username\fR=\fIUSERNAME\fR Specify the \fIusername\fR for the bucket\. Since Couchbase 5\.x this is mandatory switch, and it must specify the name of the user exisiting on cluster (read more at "Security/Authorization" section of the server manual)\. For older servers this field should be either left empty or set to the name of the bucket itself\. . .TP \fB\-P\fR, \fB\-\-password\fR=\fIPASSWORD\fR: . .TP \fB\-P \-\fR, \fB\-\-password=\-\fR Specify the password for the bucket\. As for servers before 5\.x this was only needed if the bucket is protected with a password\. For cluster version after 5\.x, the password is mandatory, and should match the selected account (read more at "Security/Authorization" section of the server manual)\. . .IP Specifying the \fB\-\fR as the password indicates that the program should prompt for the password\. You may also specify the password on the commandline, directly, but is insecure as command line arguments are visible via commands such as \fBps\fR\. . .TP \fB\-T\fR, \fB\-\-timings\fR Dump command timings at the end of execution\. This will display a histogram showing the latencies for the commands executed\. . .TP \fB\-v\fR, \fB\-\-verbose\fR Specify more information to standard error about what the client is doing\. You may specify this option multiple times for increased output detail\. . .TP \fB\-D\fR, \fB\-\-cparam\fR=OPTION=VALUE Provide additional client options\. Acceptable options can also be placed in the connection string, however this option is provided as a convenience\. This option may be specified multiple times, each time specifying a key=value pair (for example, \fB\-Doperation_timeout=10 \-Dconfig_cache=/foo/bar/baz\fR)\. See \fIADDITIONAL OPTIONS\fR for more information . .TP \fB\-y\fR, \fB\-\-compress\fR Enable compressing of documents\. When the library is compiled with compression support, this option will enable Snappy compression for outgoing data\. Incoming compressed data handled automatically regardless of this option\. Note, that because the compression support have to be negotiated with the server, first packets might be sent uncompressed even when this switch was specified\. This is because the library might queue data commands before socket connection has been established, and the library will negotiate compression feature\. If it is known that all server support compression repeating the switch (like \fB\-yy\fR) will force compression for all outgoing mutations, even scheduled before establishing connection\. . .TP \fB\-\-truststorepath\fR=\fIPATH\fR The path to the server\'s SSL certificate\. This is typically required for SSL connectivity unless the certificate has already been added to the OpenSSL installation on the system (only applicable with \fBcouchbases://\fR scheme) . .TP \fB\-\-certpath\fR=\fIPATH\fR The path to the server\'s SSL certificate\. This is typically required for SSL connectivity unless the certificate has already been added to the OpenSSL installation on the system (only applicable with \fBcouchbases://\fR scheme)\. This also should contain client certificate when certificate authentication used, and in this case other public certificates could be extracted into \fBtruststorepath\fR chain\. . .TP \fB\-\-keypath\fR=\fIPATH\fR The path to the client SSL private key\. This is typically required for SSL client certificate authentication\. The certificate itself have to go first in chain specified by \fBcertpath\fR (only applicable with \fBcouchbases://\fR scheme) . .TP \fB\-\-dump\fR Dump verbose internal state after operations are done\. . .TP \fBd\fR, \fB\-\-durability\fR=\fILEVEL\fR Specify durability level for mutation operations\. Known values are: "none", "majority", "majority_and_persist_to_active", "persist_to_majority"\. . .TP \fBp\fR, \fB\-\-persist\-to\fR=\fINUMNODES\fR Wait until the item has been persisted to at least \fBNUMNODES\fR nodes\' disk\. If \fBNUMNODES\fR is 1 then wait until only the master node has persisted the item for this key\. You may not specify a number greater than the number of nodes actually in the cluster\. \fB\-1\fR is special value, which mean to use all available nodes\. . .TP \fBr\fR \fB\-\-replicate\-to\fR=\fINREPLICAS\fR Wait until the item has been replicated to at least \fBNREPLICAS\fR replica nodes\. The bucket must be configured with at least one replica, and at least \fBNREPLICAS\fR replica nodes must be online\. \fB\-1\fR is special value, which mean to use all available replicas\. . .TP \fB\-\-lock\fR=\fITIME\fR This will retrieve and lock an item before update, making it inaccessible for modification until the update completed, or \fBTIME\fR has passed\. . .TP \fB\-\-json\fR Make \fBpillowfight\fR store document as JSON rather than binary\. This will allow the documents to nominally be analyzed by other Couchbase services such as Query and MapReduce\. . .IP JSON documents are created by creating an empty JSON object (\fB{}\fR) and then repeated populating it with \fBField_%d\fR property names (where \fB%d\fR is \fB1\fR and higher), and setting its value to a repeating asterisk \fB*\fR up to 16 times: . .IP "" 4 . .nf { "Field_1": "****************", "Field_2": "****************", "Field_3": "****************", "Field_4": "****************", "Field_5": "********" } . .fi . .IP "" 0 . .IP When using document size constraints, be aware that the minimum and maximum sizes (\fB\-\-min\-size\fR and \fB\-\-max\-size\fR) are not strict limits, and that the resultant sizes may be bigger or smaller by a few bytes in order to satisfy the requirements of proper JSON syntax\. . .TP \fB\-\-noop\fR Use couchbase NOOP operations when running the workload\. This mode ignores population, and all other document operations\. Useful as the most lightweight workload\. . .TP \fB\-\-subdoc\fR Use couchbase sub\-document operations when running the workload\. In this mode \fBpillowfight\fR will use Couchbase sub\-document operations \fIhttp://blog\.couchbase\.com/2016/february/subdoc\-explained\fR to perform gets and sets of data\. This option must be used with \fB\-\-json\fR . .TP \fB\-\-pathcount\fR Specify the number of paths a single sub\-document operation should contain\. By default, each subdoc operation operates on only a single path within the document\. You can specify multiple paths to atomically executed multiple subdoc operations within a single command\. . .IP This option does not affect the \fB\-\-batch\-size\fR option as a subdoc command is considered as a single command (with respect to batching) regardless of how many operations it contains\. . .P \fI\fR . .SH "ADDITIONAL OPTIONS" The following options may be included in the connection string (via the \fB\-U\fR option) as URI\-style query params (e\.g\. \fBcouchbase://host/bucket?option1=value1&option2=value2\fR) or as individual key=value pairs passed to the \fB\-D\fR switch (e\.g\. \fB\-Doption1=value1 \-Doption2=value\fR)\. The \fB\-D\fR will internally build the connection string, and is provided as a convenience for options to be easily passed on the command\-line . .IP "\(bu" 4 \fBoperation_timeout=SECONDS\fR: Specify the operation timeout in seconds\. This is the time the client will wait for an operation to complete before timing it out\. The default is \fB2\.5\fR . .IP "\(bu" 4 \fBconfig_cache=PATH\fR: Enables the client to make use of a file based configuration cache rather than connecting for the bootstrap operation\. If the file does not exist, the client will first connect to the cluster and then cache the bootstrap information in the file\. . .IP "\(bu" 4 \fBtruststorepath=PATH\fR: The path to the server\'s SSL certificate\. This is typically required for SSL connectivity unless the certificate has already been added to the OpenSSL installation on the system (only applicable with \fBcouchbases://\fR scheme) . .IP "\(bu" 4 \fBcertpath=PATH\fR: The path to the server\'s SSL certificate\. This is typically required for SSL connectivity unless the certificate has already been added to the OpenSSL installation on the system (only applicable with \fBcouchbases://\fR scheme)\. This also should contain client certificate when certificate authentication used, and in this case other public certificates could be extracted into \fBtruststorepath\fR chain\. . .IP "\(bu" 4 \fBkeypath=PATH\fR: The path to the client SSL private key\. This is typically required for SSL client certificate authentication\. The certificate itself have to go first in chain specified by \fBcertpath\fR (only applicable with \fBcouchbases://\fR scheme) . .IP "\(bu" 4 \fBipv6=allow\fR: Enable IPv6\. . .IP "\(bu" 4 \fBssl=no_verify\fR: Temporarily disable certificate verification for SSL (only applicable with \fBcouchbases://\fR scheme)\. This should only be used for quickly debugging SSL functionality\. . .IP "\(bu" 4 \fBsasl_mech_force=MECHANISM\fR: Force a specific \fISASL\fR mechanism to be used when performing the initial connection\. This should only need to be modified for debugging purposes\. The currently supported mechanisms are \fBPLAIN\fR and \fBCRAM\-MD5\fR . .IP "\(bu" 4 \fBbootstrap_on=\fR: Specify the bootstrap protocol the client should use when attempting to connect to the cluster\. Options are: \fBcccp\fR: Bootstrap using the Memcached protocol (supported on clusters 2\.5 and greater); \fBhttp\fR: Bootstrap using the HTTP REST protocol (supported on any cluster version); and \fBboth\fR: First attempt bootstrap over the Memcached protocol, and use the HTTP protocol if Memcached bootstrap fails\. The default is \fBboth\fR . .IP "\(bu" 4 \fBenable_tracing=true/false\fR: Activate/deactivate end\-to\-end tracing\. . .IP "\(bu" 4 \fBtracing_orphaned_queue_flush_interval=SECONDS\fR: Flush interval for orphaned spans queue in default tracer\. This is the time the tracer will wait between repeated attempts to flush most recent orphaned spans\. Default value is 10 seconds\. . .IP "\(bu" 4 \fBtracing_orphaned_queue_size=NUMBER\fR: Size of orphaned spans queue in default tracer\. Queues in default tracer has fixed size, and it will remove information about older spans, when the limit will be reached before flushing time\. Default value is 128\. . .IP "\(bu" 4 \fBtracing_threshold_queue_flush_interval=SECONDS\fR: Flush interval for spans with total time over threshold in default tracer\. This is the time the tracer will wait between repeated attempts to flush threshold queue\. Default value is 10 seconds\. . .IP "\(bu" 4 \fBtracing_threshold_queue_size=NUMBER\fR: Size of threshold queue in default tracer\. Queues in default tracer has fixed size, and it will remove information about older spans, when the limit will be reached before flushing time\. Default value is 128\. . .IP "\(bu" 4 \fBtracing_threshold_kv=SECONDS\fR: Minimum time for the tracing span of KV service to be considered by threshold tracer\. Default value is 0\.5 seconds\. . .IP "\(bu" 4 \fBtracing_threshold_query=SECONDS\fR: Minimum time for the tracing span of QUERY service to be considered by threshold tracer\. Default value is 1 second\. . .IP "\(bu" 4 \fBtracing_threshold_view=SECONDS\fR: Minimum time for the tracing span of VIEW service to be considered by threshold tracer\. Default value is 1 second\. . .IP "\(bu" 4 \fBtracing_threshold_search=SECONDS\fR: Minimum time for the tracing span of SEARCH service to be considered by threshold tracer\. Default value is 1 second\. . .IP "\(bu" 4 \fBtracing_threshold_analytics=SECONDS\fR: Minimum time for the tracing span of ANALYTICS service to be considered by threshold tracer\. Default value is 1 second\. . .IP "" 0 . .SH "EXAMPLES" . .SS "CONNECTION EXAMPLES" The following examples show how to connect \fBpillowfight\fR to different types of cluster configurations\. . .P Connect to a bucket (\fBa_bucket\fR) on a cluster on a remote host (for servers version 5\.x+)\. It uses account \'myname\' and asks password interactively: . .IP "" 4 . .nf cbc\-pillowfight \-U couchbase://192\.168\.33\.101/a_bucket \-u myname \-P\- . .fi . .IP "" 0 . .P Run against a password\-less bucket (\fBa_bucket\fR) on a cluster on a remote host (for servers older than 5\.x): . .IP "" 4 . .nf cbc\-pillowfight \-U couchbase://192\.168\.33\.101/a_bucket . .fi . .IP "" 0 . .P Connect to an SSL cluster at \fBsecure\.net\fR\. The certificate for the cluster is stored locally at \fB/home/couchbase/couchbase_cert\.pem\fR: . .IP "" 4 . .nf cbc\-pillowfight \-U couchbases://secure\.net/topsecret_bucket?certpath=/home/couchbase/couchbase_cert\.pem . .fi . .IP "" 0 . .P Connect to an SSL cluster at \fBsecure\.net\fR, ignoring certificate verification\. This is insecure but handy for testing: . .IP "" 4 . .nf cbc\-pillowfight \-U couchbases://secure\.net/topsecret_bucket?ssl=no_verify . .fi . .IP "" 0 . .P Connect to a password protected bucket (\fBprotected\fR) on a remote host (for servers older than 5\.x): . .IP "" 4 . .nf cbc\-pillowfight \-U couchbase://remote\.host\.net/protected \-P \- Bucket password: \[char46]\[char46]\[char46] . .fi . .IP "" 0 . .P Connect to a password protected bucket (for servers older than 5\.x), specifying the password on the command line (INSECURE, but useful for testing dummy environments) . .IP "" 4 . .nf cbc\-pillowfight \-U couchbase://remote\.host\.net/protected \-P t0ps3cr3t . .fi . .IP "" 0 . .P Connect to a bucket running on a cluster with a custom REST API port . .IP "" 4 . .nf cbc\-pillowfight \-U http://localhost:9000/default . .fi . .IP "" 0 . .P Connec to bucket running on a cluster with a custom memcached port . .IP "" 4 . .nf cbc\-pillowfight \-U couchbase://localhost:12000/default . .fi . .IP "" 0 . .P Connect to a \fImemcached\fR (http://memcached\.org) cluster using the binary protocol\. A vanilla memcached cluster is not the same as a memcached bucket residing within a couchbase cluster (use the normal \fBcouchbase://\fR scheme for that): . .IP "" 4 . .nf cbc\-pillowfight \-U memcached://host1,host2,host3,host4 . .fi . .IP "" 0 . .P Connect to an SSL cluster at \fBsecure\.net\fR: . .IP "" 4 . .nf cbc\-pillowfight \-U couchbases://secure\.net/topsecret_bucket . .fi . .IP "" 0 . .P Run against a bucket (\fBa_bucket\fR) on a cluster on a remote host: . .IP "" 4 . .nf cbc\-pillowfight \-U couchbase://192\.168\.33\.101/a_bucket . .fi . .IP "" 0 . .SS "BENCHMARK EXAMPLES" The following examples show how to configure different types of workloads with pillowfight\. . .P Run with 20 threads/instances, each doing one operation at a time: . .IP "" 4 . .nf cbc\-pillowfight \-t 20 \-B 1 . .fi . .IP "" 0 . .P Run 100 iterations of 2MB item sizes, using a dataset of 50 items . .IP "" 4 . .nf cbc\-pillowfight \-M $(1024*1024) \-m $(1024*1024) \-c 100 \-I 50 . .fi . .IP "" 0 . .P Use JSON documents of 100k each . .IP "" 4 . .nf cbc\-pillowfight \-\-json \-m 100000 \-M 100000 . .fi . .IP "" 0 . .P Stress\-test sub\-document mutations . .IP "" 4 . .nf cbc\-pillowfight \-\-json \-\-subdoc \-\-set\-pct 100 . .fi . .IP "" 0 . .SH "TODO" Rather than spawning threads for multiple instances, offer a way to have multiple instances function cooperatively inside an event loop\. . .SH "BUGS" This command\'s options are subject to change\. . .SH "SEE ALSO" cbc(1), cbcrc(4) . .SH "HISTORY" The \fBcbc\-pillowfight\fR tool was first introduced in libcouchbase 2\.0\.7