stress.py
Under the contrib directory you can find the stress.py utility. This
is a tunable way to test the performance of your Cassandra cluster. The utility
uses multiprocessing to help ensure that the client is not a bottleneck in the
tests.
If no specific operation is supplied, the script will insert a number of rows.
By default, keys are chosen randomly using a Gaussian distribution with mean
NUMKEYS/2 and standard deviation of 0.1.
The options available are:
-n NUMKEYS, --num-keys=NUMKEYS
- Number of keys to write or read. Default is 1,000,000.
-c COLUMNS, --columns=COLUMNS
- Number of columns per key. Default is 5.
-S COLUMN_SIZE --column-size=COLUMN-SIZE
- Size of column values in bytes. Default is 32 bytes. New in Cassandra 0.6.6.
-o OPERATION, --operation=OPERATION
- Operation to perform. Options are: read, insert, and rangeslice.
An insert operation is performed by default.
-d NODES, --nodes=NODES
- Host nodes (comma separated). Default is “localhost”.
-N SKIPKEYS, --skip-keys=SKIPKEYS
- Fraction of keys to skip initially. With large data sets, it may be useful
to start with a key higher than zero. Default is 0.
-C CARDINALITY --cardinality=CARDINALITY
- The number of possible unique column values. Default is 50.
-g RANGECOUNT, --keys-per-call=RANGECOUNT
- Number of keys to get_range_slices per call. Default is 1000.
-u SUPERS, --supercolumns=SUPERS
- Number of super columns per key. Default is 1.
-s STDEV, --stdev=STDEV
- Standard deviation for random keys with a Gaussian distribution. Defaults to 0.1.
-r, --random
- Use uniformly random key generator instead of a Gaussian distribution. This
is the worst-case scenario for caching. (stdev will have no effect with
this option.)
-y CFTYPE, --family-type=CFTYPE
- Column family type (either ‘regular’ or ‘super’). Default is ‘regular’.
-k, --keep-going
- Ignore errors inserting or reading.
-i INTERVAL, --progress-interval=INTERVAL
- Progress report interval in seconds. Default is 10.
-l REPLICATION, --replication-factor=REPLICATION
-e CONSISTENCY, --consistency-level=CONSISTENCY
- Consistency Level to use (ZERO, ONE,
QUORUM, DCQUORUM, ALL, or ANY). Level ZERO is only
available for inserts and ANY is removed for Cassandra 0.7. Default
is ONE.
-t THREADS, --threads=THREADS
- Number of threads or processes to use. Default is 50.
-p PORT, --port=PORT
- Thrift port to use. Defaults to 9160.
-m, --unframed
- Use unframed transport. Defaults to match the default transport for this
Cassandra release.
-f FILE, --file=FILE