· 8 years ago · Apr 08, 2018, 02:50 AM
1#
2# This is an example YAML profile for cassandra-stress
3#
4# The general form of the command line is as follows:
5#
6# cassandra-stress user profile=<profile.yaml> ops([insert|<read-op>]=<op-ratio>, ...) n=<partition-ops>
7#
8# cassandra-stress will then run multiple parallel consumers (controlled by the
9# -rate threads=<consumers> option):
10#
11# * Each consumer draws an operation at random from the list of ops;
12# * The distribution of the ops is controlled by the <op-ratio> parameter;
13# * Each op will then generate cassandra queries. When limited by the
14# <partition-ops> value:
15# * Each <read-op> will generate a single SELECT query, decrementing
16# <partition-ops> by 1;
17# * Each insert will generate multiple UPDATE queries, decrementing
18# <partition-ops> by the number of unique partitions inserted;
19# * When <partition-ops> is exhausted, cassandra-stress stops.
20
21# insert data
22# cassandra-stress user profile=/home/jake/stress1.yaml ops(insert=1)
23#
24# read, using query simple1:
25# cassandra-stress profile=/home/jake/stress1.yaml ops(simple1=1)
26#
27# mixed workload (90/10)
28# cassandra-stress user profile=/home/jake/stress1.yaml ops(insert=1,simple1=9)
29
30#
31# Keyspace info
32#
33keyspace: mview
34
35#
36# The CQL for creating a keyspace (optional if it already exists)
37#
38keyspace_definition: |
39 CREATE KEYSPACE mview WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 2};
40
41#
42# Table info
43#
44table: user_playlists
45
46#
47# The CQL for creating a table you wish to stress (optional if it already exists)
48#
49table_definition: |
50 CREATE TABLE IF NOT EXISTS mview.user_playlists
51 (
52 user_name text,
53 playlist_name text,
54 song_id text,
55 added_time bigint,
56 artist_name text,
57 genre text,
58 last_played bigint,
59 PRIMARY KEY (user_name, playlist_name, song_id)
60 ) WITH COMPACTION = { 'class': 'SizeTieredCompactionStrategy', 'enabled': false };
61
62extra_definitions:
63 - CREATE MATERIALIZED VIEW IF NOT EXISTS mview.recently_played AS
64 SELECT song_id, user_name
65 FROM user_playlists
66 WHERE song_id IS NOT NULL
67 AND playlist_name IS NOT NULL
68 AND user_name IS NOT NULL
69 AND last_played IS NOT NULL
70 PRIMARY KEY(user_name, last_played, playlist_name, song_id) WITH COMPACTION = { 'class': 'SizeTieredCompactionStrategy', 'enabled': false };
71#
72# Optional meta information on the generated columns in the above table
73# The min and max only apply to text and blob types
74# The distribution field represents the total unique population
75# distribution of that column across rows. Supported types are
76#
77# EXP(min..max) An exponential distribution over the range [min..max]
78# EXTREME(min..max,shape) An extreme value (Weibull) distribution over the range [min..max]
79# GAUSSIAN(min..max,stdvrng) A gaussian/normal distribution, where mean=(min+max)/2, and stdev is (mean-min)/stdvrng
80# GAUSSIAN(min..max,mean,stdev) A gaussian/normal distribution, with explicitly defined mean and stdev
81# UNIFORM(min..max) A uniform distribution over the range [min, max]
82# FIXED(val) A fixed distribution, always returning the same value
83# SEQ(min..max) A fixed sequence, returning values in the range min to max sequentially (starting based on seed), wrapping if necessary.
84# Aliases: extr, gauss, normal, norm, weibull
85#
86# If preceded by ~, the distribution is inverted
87#
88# Defaults for all columns are size: uniform(4..8), population: uniform(1..100B), cluster: fixed(1)
89#
90columnspec:
91 - name: user_name
92 size: uniform(1..100)
93 population: uniform(1..1B) # the range of unique values to select for the field (default is 100Billion)
94 - name: song_id
95 population: gaussian(1..100000)
96 cluster: uniform(1..2)
97
98
99# The insert operation
100insert:
101 partitions: uniform(1..1) # Number of unique partitions to update in a single insert op.
102 # Defaults to fixed(1)
103 partitions-per-batch: SINGLE # SINGLE or MULTIPLE partitions per-batch; multiple partitions in a
104 # single batch is a pessimization, but it's allowed. Defaults to SINGLE.
105 max-rows-per-batch: uniform(1..1)
106 # Maximum size of a batch. Rows are inserted in batches of up to
107 # max-rows-per-batch, and after each batch is sent max-rows-per-batch
108 # is regenerated from this distribution. If the generated value is 0,
109 # then each partition (for SINGLE partitions-per-batch) or all partitions
110 # (for MULTIPLE partitions-per-batch) is inserted in a single batch (so if you
111 # always require this behaviour, use fixed(0)). Defaults to fixed(100).
112 batchtype: UNLOGGED # Type of batch to use: LOGGED, UNLOGGED or COUNTER
113 select: uniform(1..10)/10 # Proportion of rows that will be generated in each partition. The number of rows
114 # per-partition will be determined by <select-value> * <partition-size>, where
115 # <partition-size> is the number of possible rows in a partition, as determined by
116 # the columns with cluster keys in the columnspec above. This will be
117 # generated for each partition in a single insert op.
118 # Defaults to fixed(1)/1
119 row-population: fixed(1)/1 # Proportion of populated columns in a row.
120 # Defaults to fixed(1)/1
121#
122#
123# A list of queries you wish to run against the schema
124#
125queries:
126 simple1:
127 cql: select * from mview.user_playlists LIMIT 100
128 fields: samerow # samerow or multirow (select arguments from the same row, or randomly from all rows in the partition)
129# range1:
130# cql: select * from typestest where name = ? and choice = ? and date >= ? LIMIT 100
131# fields: multirow # samerow or multirow (select arguments from the same row, or randomly from all rows in the partition)
132#
133# A list of bulk read queries that analytics tools may perform against the schema
134# Each query will sweep an entire token range, page by page.
135#
136# token_range_queries:
137# all_columns_tr_query:
138# columns: '*'
139# page_size: 5000
140
141# value_tr_query:
142# columns: value