cassandra-stress mixed
Interleave basic commands with configurable ratio and distribution. The cluster must first be populated by a write test.
Synopsis
cassandra-stress mixed [arguments]
Command options
- cl=?
-
Set the consistency level to use during
cassandra-stress. Options areONE,QUORUM,LOCAL_ONE(default),LOCAL_QUORUM,EACH_QUORUM,ALL, andANY. - clustering=DIST(?)
-
Distribution clustering runs of operations of the same kind.
- duration=?
-
Specify the time to run, in seconds, minutes, or hours.
- err<?
-
Specify a standard error of the mean. When this value is reached,
cassandra-stresswill end.Default:
0.02 - n>?
-
Specify a minimum number of iterations to run before accepting uncertainly convergence.
- n<?
-
Specify a maximum number of iterations to run before accepting uncertainly convergence.
- n=?
-
Specify the number of operations to run.
- no-warmup
-
Do not warmup the process. Do a cold start.
- ops(?)
-
Specify what operations to run and the number of each. Only valid with the
useroption. - profile=?
-
Designate the YAML file to use with
cassandra-stress. Only valid with theuseroption. - truncate=?
-
Truncate the table created during
cassandra-stress. Options arenever,once,always.Default:
neverThe
truncateoption must be inserted before themodeargument, otherwise thecassandra-stresstool won’t apply truncation as specified.
Command arguments
- -col
-
Column details, such as size and count distribution, data generator, names, and comparator:
Supports multiple syntax formats:
-col names=? [slice] [super=?] [comparator=?] [timestamp=?] [size=DIST(?)]-col [n=DIST(?)] [slice] [super=?] [comparator=?] [timestamp=?] [size=DIST(?)] - -errors
-
How to handle errors when encountered during stress testing:
-errors [retries=N] [ignore] [skip-read-validation]-
retries=<N>: Number of times to try each operation before failing. -
ignore: If included, won’t fail on errors. Omit this argument to fail on errors. -
skip-read-validation: Include to skip read validation and message output.
-
- -graph
-
Graph results of
cassandra-stresstests. Multiple tests can be graphed together.-graph file=? [revision=?] [title=?] [op=?] - -insert
-
Insert specific options relating to various methods for batching and splitting partition updates.
-insert [revisit=DIST(?)] [visits=DIST(?)] partitions=DIST(?) [batchtype=?] select-ratio=DIST(?) row-population-ratio=DIST(?) - -log
-
Where to log progress and the interval to use.
-log [level=?] [no-summary] [file=?] [hdrfile=?] [interval=?] [no-settings] [no-progress] [show-queries] [query-log-file=?] - -mode
-
Thrift or CQL with options. Supports multiple syntax formats:
-mode thrift [smart] [user=?] [password=?]-mode native [unprepared] cql3 [compression=?] [port=?] [user=?] [password=?] [auth-provider=?] [maxPending=?] [connectionsPerHost=?] [protocolVersion=?]-mode simplenative [prepared] cql3 [port=?] - -node
-
Nodes to connect to.
-node [datacenter=?] [whitelist] [file=?] - -pop
-
Population distribution and intra-partition visit order. Supports multiple syntax formats:
-pop seq=? [no-wrap] [read-lookback=DIST(?)] [contents=?]-pop [dist=DIST(?)] [contents=?] - -port
-
Specify port for connecting nodes. Port can be specified for Apache Cassandra native protocol (
native=), Thrift protocol (thrift=), or a JMX port (jmx=) for retrieving statistics.-port [native=?] [thrift=?] [jmx=?] - -rate
-
Set the rate. Supports multiple syntax formats:
-
Throttle to a fixed rate of operations per second with a specified number of threads:
-rate threads=? [throttle=?] [fixed=?]-
threads=?: Number of clients to run concurrently. -
throttle=?: Throttle operations per second across all clients to a maximum rate (or less) with no implied schedule. Default: 0 -
fixed=?: Expect fixed rate of operations per second across all clients with implied schedule. Default: 0
-
-
Gradually increase the number of threads until a specified minimum or maximum is reached, or until throughput saturates:
-rate [threads>=?] [threads<=?] [auto]-
threads>=?: Run at least this many clients concurrently. Default: 4 -
threads⇐?: Run at most this many clients concurrently. Default: 1000 -
auto: Stop increasing threads once throughput saturates.
-
-
- -schema
-
Schema configuration including replication settings, keyspace, compression, and compaction:
-schema [replication(?)] [keyspace=?] [compaction(?)] [compression=?] - -sendto
-
Specify a server to send the stress command to.
-sendto <host> - -tokenrange
-
Token range settings.
-tokenrange [no-wrap] [split-factor=?] [savedata=?] - -transport
-
Custom transport factories.
-transport [factory=?] [truststore=?] [truststore-password=?] [keystore=?] [keystore-password=?] [ssl-protocol=?] [ssl-alg=?] [store-type=?] [ssl-ciphers=?]
Run a mixed workload
When running a mixed workload, you must escape parentheses, greater-than and less-than signs, and other such things. This example invokes a workload that is one-quarter writes and three-quarters reads.
cassandra-stress mixed ratio\(write=1,read=3\) n=100000 cl=ONE -pop dist=UNIFORM\(1..1000000\) -schema keyspace="keyspace1" -mode native cql3 -rate threads\>=16 threads\<=256 -log file=~/mixed_autorate_50r50w_1M.log
Notice the following in this example:
-
The
ratioparameter requires backslash-escaped parenthesis. -
The value of
nused in the read phase is different from the value used in write phase. During the write phase,nrecords are written. However in the read phase, ifnis too large, it is inconvenient to read all the records for simple testing. Generally,ndoes not need be large when validating the persistent storage systems of a cluster.The
-pop dist=UNIFORM\(1..1000000\)portion says that of the n=100,000 operations, select the keys uniformly distributed between 1 and 1,000,000. Use this when you want to specify more data per node than what fits in DRAM. -
In the
ratesection, the greater-than and less-than signs are escaped. If not escaped, the shell attempts to use them for IO redirection: the shell tries to read from a non-existent file called=256and create a file called=16. Theratesection tells cassandra-stress to automatically attempt different numbers of client threads and not test less that 16 or more than 256 client threads.