Stress Testing Cassandra

The cassandra-stress tool is a Java-based stress testing utility for basic benchmarking and load testing a Cassandra cluster. It comes with Apache Cassandra binary package.

Cassandra stress help on user command

$ tools/bin/cassandra-stress help user
Usage: user profile=? ops(?) [clustering=DIST(?)] [err<?] [n>?] [n<?] [no-warmup] [truncate=?] [cl=?]
OR
Usage: user profile=? n=? ops(?) [clustering=DIST(?)] [no-warmup] [truncate=?] [cl=?]
OR
Usage: user profile=? duration=? ops(?) [clustering=DIST(?)] [no-warmup] [truncate=?] [cl=?]
profile=? Specify the path to a yaml cql3 profile
ops(null): Specify the ratios for inserts/queries to perform; e.g. ops(insert=2,<query1>=1) will perform 2 inserts for each query1
null
[clustering=DIST(?)]: Distribution clustering runs of operations of the same kind
EXP(min..max) An exponential distribution over the range [min..max]
EXTREME(min..max,shape) An extreme value (Weibull) distribution over the range [min..max]
QEXTREME(min..max,shape,quantas) An extreme value, split into quantas, within which the chance of selection is uniform
GAUSSIAN(min..max,stdvrng) A gaussian/normal distribution, where mean=(min+max)/2, and stdev is (mean-min)/stdvrng
GAUSSIAN(min..max,mean,stdev) A gaussian/normal distribution, with explicitly defined mean and stdev
UNIFORM(min..max) A uniform distribution over the range [min, max]
FIXED(val) A fixed distribution, always returning the same value
SEQ(min..max) A fixed sequence, returning values in the range min to max sequentially (starting based on seed), wrapping if necessary.
Preceding the name with ~ will invert the distribution, e.g. ~exp(1..10) will yield 10 most, instead of least, often
Aliases: extr, qextr, gauss, normal, norm, weibull
err<? (default=0.02) Run until the standard error of the mean is below this fraction
n>? (default=30) Run at least this many iterations before accepting uncertainty convergence
n<? (default=200) Run at most this many iterations before accepting uncertainty convergence
no-warmup Do not warmup the process
truncate=? (default=never) Truncate the table: never, before performing any work, or before each iteration
cl=? (default=LOCAL_ONE) Consistency level to use
n=? Number of operations to perform
duration=? Time to run in (in seconds, minutes or hours)

Running stress on custom tables.

Create a new keyspace named: perftesting.

Create a file stress.yaml inside a directory of your choice with the following content

table: users

keyspace: perftesting
table_definition:
  CREATE TABLE users (
    username text,
    first_name text,
    last_name text,
    password text,
    email text,
    startdate date,
    last_access timeuuid,
    description text,
    PRIMARY KEY(username)
  );
extra_definitions:
  - CREATE MATERIALIZED VIEW perftesting.users_by_first_name AS SELECT * FROM perftesting.users WHERE first_name IS NOT NULL and username IS NOT NULL PRIMARY KEY (first_name, username);
  - CREATE MATERIALIZED VIEW perftesting.users_by_first_name2 AS SELECT * FROM perftesting.users WHERE first_name IS NOT NULL and username IS NOT NULL PRIMARY KEY (first_name, username);
  - CREATE MATERIALIZED VIEW perftesting.users_by_first_name3 AS SELECT * FROM perftesting.users WHERE first_name IS NOT NULL and username IS NOT NULL PRIMARY KEY (first_name, username);
columnspec:
  - name: username
    size: uniform(10..30)
  - name: first_name
    size: fixed(16)
  - name: last_name
    size: uniform(1..32)
  - name: password
    size: fixed(80) # sha-512
  - name: email
    size: uniform(16..50)
  - name: startdate
    cluster: uniform(20...40)
  - name: description
    size: gaussian(100...500)
insert:
  partitions: fixed(10) # Insert data into 10 partitions each time
queries:
  read1:
    cql: select * from users where username = ? 
    fields: samerow     # samerow or multirow (select arguments from the same row, or randomly from all rows in the partition)
$ tools/bin/cassandra-stress user profile=stress.yaml n=20000 ops\(insert=3,read1=1\) truncate=once no-warmup cl=ONE

Note:

  • The user option is required for the profile and opt parameters.
  • The value for the profile parameter is the path and filename of the .yaml file.
  • In this example, -n specifies the number of batches that run.
  • The values supplied for ops specifies which operations run and how many of each. These values direct the command to insert rows into the database and run the read1 query.
  • How many times? Each insert or query counts as one batch, and the values in ops determine how many of each type are run. Since the total number of batches is 1,000,000, and ops says to run three inserts for each query, the result will be 750,000 inserts and 250,000 of the read1 query.
  • Use escaping backslashes when specifying the ops value.

Results (note: below numbers are based on a prod grade server with default settings):

$ tools/bin/cassandra-stress user profile=cqlstress.yaml n=20000 ops\(insert=3,read1=1\) no-warmup cl=ONE
WARN  14:16:06 You listed localhost/0:0:0:0:0:0:0:1:9042 in your contact points, but it wasn't found in the control host's system.peers at startup
Connected to cluster: Test Cluster, max pending requests per connection 133, max connections per host 8
Datatacenter: datacenter1; Host: localhost/127.0.0.1; Rack: rack1
Created schema. Sleeping 1s for propagation.
Created extra schema. Sleeping 1s for propagation.
Sleeping 2s...
Running with 4 threadCount
Running [insert, read1] with 4 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
Generating batches with [10..10] partitions and [10..10] rows (of [10..10] total rows in the partitions)
insert,          575,     575,    5750,    5750,     6.2,     4.9,    12.1,    21.8,    68.9,    70.1,    1.0,  0.00000,      0,      0,       0,       0,       0,       0
read1,           156,     156,      15,      15,     2.4,     1.8,     5.4,     8.0,    20.7,    20.7,    1.0,  0.00000,      0,      0,       0,       0,       0,       0
total,           731,     731,    5765,    5765,     5.4,     4.3,    11.6,    20.7,    68.9,    70.1,    1.0,  0.00000,      0,      0,       0,       0,       0,       0
insert,          691,      93,     928,     928,     2.9,     2.5,     5.1,     8.1,    10.7,    10.7,    2.2,  0.51920,      0,      0,       0,       0,       0,       0
read1,           182,      21,      14,      14,     0.7,     0.6,     1.3,     1.4,     1.4,     1.4,    2.2,  0.51920,      0,      0,       0,       0,       0,       0
total,           873,     114,     942,     942,     2.5,     2.4,     4.9,     8.1,    10.7,    10.7,    2.2,  0.51920,      0,      0,       0,       0,       0,       0
Results:
Op rate                   :      388 op/s  [insert: 307 op/s, read1: 81 op/s]
Partition rate            :    3,086 pk/s  [insert: 3,071 pk/s, read1: 15 pk/s]
Row rate                  :    3,086 row/s [insert: 3,071 row/s, read1: 15 row/s]
Latency mean              :    4.9 ms [insert: 5.7 ms, read1: 2.1 ms]
Latency median            :    3.8 ms [insert: 4.5 ms, read1: 1.6 ms]
Latency 95th percentile   :   11.1 ms [insert: 11.7 ms, read1: 5.1 ms]
Latency 99th percentile   :   19.5 ms [insert: 20.1 ms, read1: 8.0 ms]
Latency 99.9th percentile :   68.9 ms [insert: 68.9 ms, read1: 20.7 ms]
Latency max               :   70.1 ms [insert: 70.1 ms, read1: 20.7 ms]
Total partitions          :      6,943 [insert: 6,910, read1: 33]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 0
Total GC memory           : 0.000 KiB
Total GC time             :    0.0 seconds
Avg GC time               :    NaN ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:02
Sleeping for 15s
Running with 8 threadCount
Running [insert, read1] with 8 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,          122,     113,    1128,    1128,     4.4,     3.8,     9.1,    10.9,    13.7,    13.7,    1.1,  0.00000,      0,      0,       0,       0,       0,       0
read1,            11,      10,       7,       7,     1.3,     0.8,     2.5,     3.6,     3.6,     3.6,    1.1,  0.00000,      0,      0,       0,       0,       0,       0
total,           133,     123,    1136,    1136,     4.1,     3.8,     8.9,    10.9,    13.7,    13.7,    1.1,  0.00000,      0,      0,       0,       0,       0,       0
Results:
Op rate                   :      123 op/s  [insert: 113 op/s, read1: 10 op/s]
Partition rate            :    1,136 pk/s  [insert: 1,128 pk/s, read1: 7 pk/s]
Row rate                  :    1,136 row/s [insert: 1,128 row/s, read1: 7 row/s]
Latency mean              :    4.1 ms [insert: 4.4 ms, read1: 1.3 ms]
Latency median            :    3.8 ms [insert: 3.8 ms, read1: 0.8 ms]
Latency 95th percentile   :    8.9 ms [insert: 9.1 ms, read1: 2.5 ms]
Latency 99th percentile   :   10.9 ms [insert: 10.9 ms, read1: 3.6 ms]
Latency 99.9th percentile :   13.7 ms [insert: 13.7 ms, read1: 3.6 ms]
Latency max               :   13.7 ms [insert: 13.7 ms, read1: 3.6 ms]
Total partitions          :      1,224 [insert: 1,216, read1: 8]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 0
Total GC memory           : 0.000 KiB
Total GC time             :    0.0 seconds
Avg GC time               :    NaN ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:01
Improvement over 4 threadCount: -68%
Sleeping for 15s
Running with 16 threadCount
Running [insert, read1] with 16 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1693,    1694,   16944,   16944,     8.8,     7.5,    13.5,    30.1,    96.2,    98.0,    1.0,  0.00000,      0,      1,      81,      81,       0,     594
read1,           713,     713,     634,     634,     1.3,     0.9,     2.9,     6.0,    12.5,    90.0,    1.0,  0.00000,      0,      1,      81,      81,       0,     594
total,          2406,    2406,   17565,   17565,     6.6,     6.6,    12.2,    28.3,    96.2,    98.0,    1.0,  0.00000,      0,      1,      81,      81,       0,     594
Results:
Op rate                   :    2,406 op/s  [insert: 1,694 op/s, read1: 713 op/s]
Partition rate            :   17,565 pk/s  [insert: 16,944 pk/s, read1: 634 pk/s]
Row rate                  :   17,565 row/s [insert: 16,944 row/s, read1: 634 row/s]
Latency mean              :    6.6 ms [insert: 8.8 ms, read1: 1.3 ms]
Latency median            :    6.6 ms [insert: 7.5 ms, read1: 0.9 ms]
Latency 95th percentile   :   12.2 ms [insert: 13.5 ms, read1: 2.9 ms]
Latency 99th percentile   :   28.3 ms [insert: 30.1 ms, read1: 6.0 ms]
Latency 99.9th percentile :   96.2 ms [insert: 96.2 ms, read1: 12.5 ms]
Latency max               :   98.0 ms [insert: 98.0 ms, read1: 90.0 ms]
Total partitions          :     17,564 [insert: 16,930, read1: 634]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 1
Total GC memory           : 594.332 MiB
Total GC time             :    0.1 seconds
Avg GC time               :   81.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:00
Improvement over 8 threadCount: 1857%
Sleeping for 15s
Running with 24 threadCount
Running [insert, read1] with 24 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1936,    2173,   21725,   21725,    10.6,     8.6,    15.1,    78.8,    81.1,    84.2,    0.9,  0.00000,      0,      2,      69,     118,      10,    1199
read1,           646,     729,     697,     697,     1.0,     0.8,     2.3,     3.9,     5.5,    13.3,    0.9,  0.00000,      0,      2,      69,     118,      10,    1199
total,          2582,    2898,   22417,   22417,     8.2,     8.0,    13.6,    65.6,    80.8,    84.2,    0.9,  0.00000,      0,      2,      69,     118,      10,    1199
Results:
Op rate                   :    2,898 op/s  [insert: 2,173 op/s, read1: 729 op/s]
Partition rate            :   22,417 pk/s  [insert: 21,725 pk/s, read1: 697 pk/s]
Row rate                  :   22,417 row/s [insert: 21,725 row/s, read1: 697 row/s]
Latency mean              :    8.2 ms [insert: 10.6 ms, read1: 1.0 ms]
Latency median            :    8.0 ms [insert: 8.6 ms, read1: 0.8 ms]
Latency 95th percentile   :   13.6 ms [insert: 15.1 ms, read1: 2.3 ms]
Latency 99th percentile   :   65.6 ms [insert: 78.8 ms, read1: 3.9 ms]
Latency 99.9th percentile :   80.8 ms [insert: 81.1 ms, read1: 5.5 ms]
Latency max               :   84.2 ms [insert: 84.2 ms, read1: 13.3 ms]
Total partitions          :     19,971 [insert: 19,354, read1: 617]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 2
Total GC memory           : 1.171 GiB
Total GC time             :    0.1 seconds
Avg GC time               :   59.0 ms
StdDev GC time            :   10.0 ms
Total operation time      : 00:00:00
Improvement over 16 threadCount: 21%
Sleeping for 15s
Running with 36 threadCount
Running [insert, read1] with 36 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1938,    2770,   27696,   27696,    12.5,    11.2,    17.5,    59.4,    65.4,    67.2,    0.7,  0.00000,      0,      1,      47,      47,       0,     597
read1,           622,     905,     864,     864,     1.1,     0.8,     2.8,     4.3,     6.1,    15.9,    0.7,  0.00000,      0,      1,      47,      47,       0,     597
total,          2560,    3659,   28545,   28545,     9.7,    10.4,    16.0,    58.6,    64.1,    67.2,    0.7,  0.00000,      0,      1,      47,      47,       0,     597
Results:
Op rate                   :    3,659 op/s  [insert: 2,770 op/s, read1: 905 op/s]
Partition rate            :   28,545 pk/s  [insert: 27,696 pk/s, read1: 864 pk/s]
Row rate                  :   28,545 row/s [insert: 27,696 row/s, read1: 864 row/s]
Latency mean              :    9.7 ms [insert: 12.5 ms, read1: 1.1 ms]
Latency median            :   10.4 ms [insert: 11.2 ms, read1: 0.8 ms]
Latency 95th percentile   :   16.0 ms [insert: 17.5 ms, read1: 2.8 ms]
Latency 99th percentile   :   58.6 ms [insert: 59.4 ms, read1: 4.3 ms]
Latency 99.9th percentile :   64.1 ms [insert: 65.4 ms, read1: 6.1 ms]
Latency max               :   67.2 ms [insert: 67.2 ms, read1: 15.9 ms]
Total partitions          :     19,972 [insert: 19,378, read1: 594]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 1
Total GC memory           : 596.619 MiB
Total GC time             :    0.0 seconds
Avg GC time               :   47.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:00
Improvement over 24 threadCount: 27%
Sleeping for 15s
Running with 54 threadCount
Running [insert, read1] with 54 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1935,    2708,   27078,   27078,    19.0,    17.5,    42.8,    62.9,    66.2,    70.5,    0.7,  0.00000,      0,      1,      44,      44,       0,     600
read1,           654,     931,     906,     906,     1.7,     1.0,     4.9,     8.2,    36.4,    36.8,    0.7,  0.00000,      0,      1,      44,      44,       0,     600
total,          2589,    3624,   27970,   27970,    14.6,    15.8,    24.4,    62.1,    66.2,    70.5,    0.7,  0.00000,      0,      1,      44,      44,       0,     600
Results:
Op rate                   :    3,624 op/s  [insert: 2,708 op/s, read1: 931 op/s]
Partition rate            :   27,970 pk/s  [insert: 27,078 pk/s, read1: 906 pk/s]
Row rate                  :   27,970 row/s [insert: 27,078 row/s, read1: 906 row/s]
Latency mean              :   14.6 ms [insert: 19.0 ms, read1: 1.7 ms]
Latency median            :   15.8 ms [insert: 17.5 ms, read1: 1.0 ms]
Latency 95th percentile   :   24.4 ms [insert: 42.8 ms, read1: 4.9 ms]
Latency 99th percentile   :   62.1 ms [insert: 62.9 ms, read1: 8.2 ms]
Latency 99.9th percentile :   66.2 ms [insert: 66.2 ms, read1: 36.4 ms]
Latency max               :   70.5 ms [insert: 70.5 ms, read1: 36.8 ms]
Total partitions          :     19,983 [insert: 19,346, read1: 637]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 1
Total GC memory           : 600.086 MiB
Total GC time             :    0.0 seconds
Avg GC time               :   44.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:00
Improvement over 36 threadCount: -1%
Sleeping for 15s
Running with 81 threadCount
Running [insert, read1] with 81 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1915,    3068,   30675,   30675,    24.8,    21.6,    50.0,    66.6,    68.6,    68.8,    0.6,  0.00000,      0,      1,      39,      39,       0,     601
read1,           855,    1412,    1387,    1387,     1.8,     1.0,     4.6,    12.5,    48.3,    49.8,    0.6,  0.00000,      0,      1,      39,      39,       0,     601
total,          2770,    4438,   32021,   32021,    17.7,    20.0,    41.3,    66.2,    68.5,    68.8,    0.6,  0.00000,      0,      1,      39,      39,       0,     601
Results:
Op rate                   :    4,438 op/s  [insert: 3,068 op/s, read1: 1,412 op/s]
Partition rate            :   32,021 pk/s  [insert: 30,675 pk/s, read1: 1,387 pk/s]
Row rate                  :   32,021 row/s [insert: 30,675 row/s, read1: 1,387 row/s]
Latency mean              :   17.7 ms [insert: 24.8 ms, read1: 1.8 ms]
Latency median            :   20.0 ms [insert: 21.6 ms, read1: 1.0 ms]
Latency 95th percentile   :   41.3 ms [insert: 50.0 ms, read1: 4.6 ms]
Latency 99th percentile   :   66.2 ms [insert: 66.6 ms, read1: 12.5 ms]
Latency 99.9th percentile :   68.5 ms [insert: 68.6 ms, read1: 48.3 ms]
Latency max               :   68.8 ms [insert: 68.8 ms, read1: 49.8 ms]
Total partitions          :     19,985 [insert: 19,145, read1: 840]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 1
Total GC memory           : 600.583 MiB
Total GC time             :    0.0 seconds
Avg GC time               :   39.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:00
Improvement over 54 threadCount: 23%
Sleeping for 15s
Running with 121 threadCount
Running [insert, read1] with 121 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1916,    3101,   31007,   31007,    36.0,    32.2,    98.3,   107.2,   122.6,   134.5,    0.6,  0.00000,      0,      1,      38,      38,       0,     597
read1,           840,    1407,    1382,    1382,     2.5,     1.2,     7.8,    24.4,    44.2,    57.9,    0.6,  0.00000,      0,      1,      38,      38,       0,     597
total,          2756,    4460,   32342,   32342,    25.8,    29.2,    57.9,   105.6,   116.7,   134.5,    0.6,  0.00000,      0,      1,      38,      38,       0,     597
Results:
Op rate                   :    4,460 op/s  [insert: 3,101 op/s, read1: 1,407 op/s]
Partition rate            :   32,342 pk/s  [insert: 31,007 pk/s, read1: 1,382 pk/s]
Row rate                  :   32,342 row/s [insert: 31,007 row/s, read1: 1,382 row/s]
Latency mean              :   25.8 ms [insert: 36.0 ms, read1: 2.5 ms]
Latency median            :   29.2 ms [insert: 32.2 ms, read1: 1.2 ms]
Latency 95th percentile   :   57.9 ms [insert: 98.3 ms, read1: 7.8 ms]
Latency 99th percentile   :  105.6 ms [insert: 107.2 ms, read1: 24.4 ms]
Latency 99.9th percentile :  116.7 ms [insert: 122.6 ms, read1: 44.2 ms]
Latency max               :  134.5 ms [insert: 134.5 ms, read1: 57.9 ms]
Total partitions          :     19,985 [insert: 19,160, read1: 825]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 1
Total GC memory           : 596.996 MiB
Total GC time             :    0.0 seconds
Avg GC time               :   38.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:00
Improvement over 81 threadCount: 1%
Sleeping for 15s
Running with 181 threadCount
Running [insert, read1] with 181 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1925,    3131,   31312,   31312,    50.1,    44.8,    91.9,   101.4,   104.3,   107.2,    0.6,  0.00000,      0,      1,      43,      43,       0,     602
read1,           750,    1282,    1265,    1265,     9.5,     9.8,    16.2,    64.9,    72.5,    76.0,    0.6,  0.00000,      0,      1,      43,      43,       0,     602
total,          2675,    4351,   32515,   32515,    38.7,    42.7,    90.8,   100.7,   103.8,   107.2,    0.6,  0.00000,      0,      1,      43,      43,       0,     602
Results:
Op rate                   :    4,351 op/s  [insert: 3,131 op/s, read1: 1,282 op/s]
Partition rate            :   32,515 pk/s  [insert: 31,312 pk/s, read1: 1,265 pk/s]
Row rate                  :   32,515 row/s [insert: 31,312 row/s, read1: 1,265 row/s]
Latency mean              :   38.7 ms [insert: 50.1 ms, read1: 9.5 ms]
Latency median            :   42.7 ms [insert: 44.8 ms, read1: 9.8 ms]
Latency 95th percentile   :   90.8 ms [insert: 91.9 ms, read1: 16.2 ms]
Latency 99th percentile   :  100.7 ms [insert: 101.4 ms, read1: 64.9 ms]
Latency 99.9th percentile :  103.8 ms [insert: 104.3 ms, read1: 72.5 ms]
Latency max               :  107.2 ms [insert: 107.2 ms, read1: 76.0 ms]
Total partitions          :     19,990 [insert: 19,250, read1: 740]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 1
Total GC memory           : 601.937 MiB
Total GC time             :    0.0 seconds
Avg GC time               :   43.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:00
Improvement over 121 threadCount: -2%
Sleeping for 15s
Running with 271 threadCount
Running [insert, read1] with 271 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1920,    3228,   32278,   32278,    65.0,    56.8,   127.2,   134.5,   139.3,   149.2,    0.6,  0.00000,      0,      1,      48,      48,       0,     595
read1,           803,    1407,    1382,    1382,    24.2,    23.1,    64.4,   101.8,   102.5,   102.5,    0.6,  0.00000,      0,      1,      48,      48,       0,     595
total,          2723,    4578,   33604,   33604,    53.0,    53.6,   123.8,   133.4,   138.9,   149.2,    0.6,  0.00000,      0,      1,      48,      48,       0,     595
Results:
Op rate                   :    4,578 op/s  [insert: 3,228 op/s, read1: 1,407 op/s]
Partition rate            :   33,604 pk/s  [insert: 32,278 pk/s, read1: 1,382 pk/s]
Row rate                  :   33,604 row/s [insert: 32,278 row/s, read1: 1,382 row/s]
Latency mean              :   53.0 ms [insert: 65.0 ms, read1: 24.2 ms]
Latency median            :   53.6 ms [insert: 56.8 ms, read1: 23.1 ms]
Latency 95th percentile   :  123.8 ms [insert: 127.2 ms, read1: 64.4 ms]
Latency 99th percentile   :  133.4 ms [insert: 134.5 ms, read1: 101.8 ms]
Latency 99.9th percentile :  138.9 ms [insert: 139.3 ms, read1: 102.5 ms]
Latency max               :  149.2 ms [insert: 149.2 ms, read1: 102.5 ms]
Total partitions          :     19,986 [insert: 19,197, read1: 789]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 1
Total GC memory           : 594.666 MiB
Total GC time             :    0.0 seconds
Avg GC time               :   48.0 ms
StdDev GC time            :    0.0 ms
Total operation time      : 00:00:00
Improvement over 181 threadCount: 5%
Sleeping for 15s
Running with 406 threadCount
Running [insert, read1] with 406 threads for 20000 iteration
type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
insert,         1931,    2524,   25227,   25227,   111.1,    81.5,   309.1,   325.6,   335.3,   341.8,    0.8,  0.00000,      0,      2,      57,     110,       2,    1201
read1,           696,    1051,    1045,    1045,    46.8,    29.3,   227.7,   291.2,   303.0,   303.8,    0.7,  0.00000,      0,      2,      57,     110,       2,    1201
total,          2627,    3433,   26132,   26132,    94.1,    74.8,   302.3,   325.1,   332.9,   341.8,    0.8,  0.00000,      0,      2,      57,     110,       2,    1201
Results:
Op rate                   :    3,433 op/s  [insert: 2,524 op/s, read1: 1,051 op/s]
Partition rate            :   26,132 pk/s  [insert: 25,227 pk/s, read1: 1,045 pk/s]
Row rate                  :   26,132 row/s [insert: 25,227 row/s, read1: 1,045 row/s]
Latency mean              :   94.1 ms [insert: 111.1 ms, read1: 46.8 ms]
Latency median            :   74.8 ms [insert: 81.5 ms, read1: 29.3 ms]
Latency 95th percentile   :  302.3 ms [insert: 309.1 ms, read1: 227.7 ms]
Latency 99th percentile   :  325.1 ms [insert: 325.6 ms, read1: 291.2 ms]
Latency 99.9th percentile :  332.9 ms [insert: 335.3 ms, read1: 303.0 ms]
Latency max               :  341.8 ms [insert: 341.8 ms, read1: 303.8 ms]
Total partitions          :     19,996 [insert: 19,304, read1: 692]
Total errors              :          0 [insert: 0, read1: 0]
Total GC count            : 2
Total GC memory           : 1.173 GiB
Total GC time             :    0.1 seconds
Avg GC time               :   55.0 ms
StdDev GC time            :    2.0 ms
Total operation time      : 00:00:00
Improvement over 271 threadCount: -23%
Sleeping for 15s
             id, type       total ops,    op/s,    pk/s,   row/s,    mean,     med,     .95,     .99,    .999,     max,   time,   stderr, errors,  gc: #,  max ms,  sum ms,  sdv ms,      mb
  4 threadCount, insert,          691,     307,    3071,    3071,     5.7,     4.5,    11.7,    20.1,    68.9,    70.1,    2.2,  0.51920,      0,      0,       0,       0,       0,       0
  4 threadCount, read1,           182,      81,      15,      15,     2.1,     1.6,     5.1,     8.0,    20.7,    20.7,    2.2,  0.51920,      0,      0,       0,       0,       0,       0
  4 threadCount, total,           873,     388,    3086,    3086,     4.9,     3.8,    11.1,    19.5,    68.9,    70.1,    2.2,  0.51920,      0,      0,       0,       0,       0,       0
  8 threadCount, insert,          122,     113,    1128,    1128,     4.4,     3.8,     9.1,    10.9,    13.7,    13.7,    1.1,  0.00000,      0,      0,       0,       0,       0,       0
  8 threadCount, read1,            11,      10,       7,       7,     1.3,     0.8,     2.5,     3.6,     3.6,     3.6,    1.1,  0.00000,      0,      0,       0,       0,       0,       0
  8 threadCount, total,           133,     123,    1136,    1136,     4.1,     3.8,     8.9,    10.9,    13.7,    13.7,    1.1,  0.00000,      0,      0,       0,       0,       0,       0
 16 threadCount, insert,         1693,    1694,   16944,   16944,     8.8,     7.5,    13.5,    30.1,    96.2,    98.0,    1.0,  0.00000,      0,      1,      81,      81,       0,     594
 16 threadCount, read1,           713,     713,     634,     634,     1.3,     0.9,     2.9,     6.0,    12.5,    90.0,    1.0,  0.00000,      0,      1,      81,      81,       0,     594
 16 threadCount, total,          2406,    2406,   17565,   17565,     6.6,     6.6,    12.2,    28.3,    96.2,    98.0,    1.0,  0.00000,      0,      1,      81,      81,       0,     594
 24 threadCount, insert,         1936,    2173,   21725,   21725,    10.6,     8.6,    15.1,    78.8,    81.1,    84.2,    0.9,  0.00000,      0,      2,      69,     118,      10,    1199
 24 threadCount, read1,           646,     729,     697,     697,     1.0,     0.8,     2.3,     3.9,     5.5,    13.3,    0.9,  0.00000,      0,      2,      69,     118,      10,    1199
 24 threadCount, total,          2582,    2898,   22417,   22417,     8.2,     8.0,    13.6,    65.6,    80.8,    84.2,    0.9,  0.00000,      0,      2,      69,     118,      10,    1199
 36 threadCount, insert,         1938,    2770,   27696,   27696,    12.5,    11.2,    17.5,    59.4,    65.4,    67.2,    0.7,  0.00000,      0,      1,      47,      47,       0,     597
 36 threadCount, read1,           622,     905,     864,     864,     1.1,     0.8,     2.8,     4.3,     6.1,    15.9,    0.7,  0.00000,      0,      1,      47,      47,       0,     597
 36 threadCount, total,          2560,    3659,   28545,   28545,     9.7,    10.4,    16.0,    58.6,    64.1,    67.2,    0.7,  0.00000,      0,      1,      47,      47,       0,     597
 54 threadCount, insert,         1935,    2708,   27078,   27078,    19.0,    17.5,    42.8,    62.9,    66.2,    70.5,    0.7,  0.00000,      0,      1,      44,      44,       0,     600
 54 threadCount, read1,           654,     931,     906,     906,     1.7,     1.0,     4.9,     8.2,    36.4,    36.8,    0.7,  0.00000,      0,      1,      44,      44,       0,     600
 54 threadCount, total,          2589,    3624,   27970,   27970,    14.6,    15.8,    24.4,    62.1,    66.2,    70.5,    0.7,  0.00000,      0,      1,      44,      44,       0,     600
 81 threadCount, insert,         1915,    3068,   30675,   30675,    24.8,    21.6,    50.0,    66.6,    68.6,    68.8,    0.6,  0.00000,      0,      1,      39,      39,       0,     601
 81 threadCount, read1,           855,    1412,    1387,    1387,     1.8,     1.0,     4.6,    12.5,    48.3,    49.8,    0.6,  0.00000,      0,      1,      39,      39,       0,     601
 81 threadCount, total,          2770,    4438,   32021,   32021,    17.7,    20.0,    41.3,    66.2,    68.5,    68.8,    0.6,  0.00000,      0,      1,      39,      39,       0,     601
121 threadCount, insert,         1916,    3101,   31007,   31007,    36.0,    32.2,    98.3,   107.2,   122.6,   134.5,    0.6,  0.00000,      0,      1,      38,      38,       0,     597
121 threadCount, read1,           840,    1407,    1382,    1382,     2.5,     1.2,     7.8,    24.4,    44.2,    57.9,    0.6,  0.00000,      0,      1,      38,      38,       0,     597
121 threadCount, total,          2756,    4460,   32342,   32342,    25.8,    29.2,    57.9,   105.6,   116.7,   134.5,    0.6,  0.00000,      0,      1,      38,      38,       0,     597
181 threadCount, insert,         1925,    3131,   31312,   31312,    50.1,    44.8,    91.9,   101.4,   104.3,   107.2,    0.6,  0.00000,      0,      1,      43,      43,       0,     602
181 threadCount, read1,           750,    1282,    1265,    1265,     9.5,     9.8,    16.2,    64.9,    72.5,    76.0,    0.6,  0.00000,      0,      1,      43,      43,       0,     602
181 threadCount, total,          2675,    4351,   32515,   32515,    38.7,    42.7,    90.8,   100.7,   103.8,   107.2,    0.6,  0.00000,      0,      1,      43,      43,       0,     602
271 threadCount, insert,         1920,    3228,   32278,   32278,    65.0,    56.8,   127.2,   134.5,   139.3,   149.2,    0.6,  0.00000,      0,      1,      48,      48,       0,     595
271 threadCount, read1,           803,    1407,    1382,    1382,    24.2,    23.1,    64.4,   101.8,   102.5,   102.5,    0.6,  0.00000,      0,      1,      48,      48,       0,     595
271 threadCount, total,          2723,    4578,   33604,   33604,    53.0,    53.6,   123.8,   133.4,   138.9,   149.2,    0.6,  0.00000,      0,      1,      48,      48,       0,     595
406 threadCount, insert,         1931,    2524,   25227,   25227,   111.1,    81.5,   309.1,   325.6,   335.3,   341.8,    0.8,  0.00000,      0,      2,      57,     110,       2,    1201
406 threadCount, read1,           696,    1051,    1045,    1045,    46.8,    29.3,   227.7,   291.2,   303.0,   303.8,    0.7,  0.00000,      0,      2,      57,     110,       2,    1201
406 threadCount, total,          2627,    3433,   26132,   26132,    94.1,    74.8,   302.3,   325.1,   332.9,   341.8,    0.8,  0.00000,      0,      2,      57,     110,       2,    1201

Node Configuration:

Produce graph:

$ tools/bin/cassandra-stress user profile=stress.yaml n=20000 ops\(insert=3,read1=1\) truncate=once no-warmup cl=ONE graph file=test.html title=test revision=test1

How to run cassandra stress from a remote machine

$ tools/bin/cassandra-stress help -node

Usage: -node [datacenter=?] [whitelist] [file=?] []

datacenter=? Datacenter used for DCAwareRoundRobinLoadPolicy

whitelist Limit communications to the provided nodes

file=? Node file (one per line)

(default=localhost) comma delimited list of nodes

Example:

$ tools/bin/cassandra-stress user profile=stress.yaml n=20000 ops\(insert=3,read1=1\) truncate=once no-warmup cl=ONE -node 127.0.0.1

Compare performance under a fixed load

$ tools/bin/cassandra-stress help -rate

Usage: -rate threads=? [throttle=?] [fixed=?]

OR

Usage: -rate [threads>=?] [threads<=?] [auto]

threads=? run this many clients concurrently

throttle=? (default=0/s) throttle operations per second across all clients to a maximum rate (or less) with no implied schedule

fixed=? (default=0/s) expect fixed rate of operations per second across all clients with implied schedule

threads>=? (default=4) run at least this many clients concurrently

threads<=? (default=1000) run at most this many clients concurrently

auto stop increasing threads once throughput saturates

Reference:

  • http://docs.datastax.com/en/cassandra/3.0/cassandra/tools/toolsCStress.html
  • https://www.youtube.com/watch?v=it4yqHXu4TE
  • http://psy-lob-saw.blogspot.in/2016/07/fixing-co-in-cstress.html