3
3
SLO is the type of test where app based on ydb-sdk is tested against falling YDB cluster nodes, tablets, network
4
4
(that is possible situations for distributed DBs with hundreds of nodes)
5
5
6
- ### Implementations:
6
+ ### Workload types:
7
+
8
+ There are two workload types:
9
+
10
+ - ** Table SLO** - tests table operations (read/write)
11
+ - ** Topic SLO** - tests topic operations (publish/consume)
7
12
8
- There are two implementations :
13
+ ### Implementations :
9
14
10
15
- ` sync `
11
16
- ` async ` (now unimplemented)
12
17
13
18
### Usage:
14
19
15
- It has 3 commands:
20
+ Each workload type has 3 commands:
21
+
22
+ ** Table commands:**
23
+ - ` table-create ` - creates table in database
24
+ - ` table-cleanup ` - drops table in database
25
+ - ` table-run ` - runs table workload (read and write to table with set RPS)
16
26
17
- - ` create ` - creates table in database
18
- - ` cleanup ` - drops table in database
19
- - ` run ` - runs workload (read and write to table with sets RPS)
27
+ ** Topic commands:**
28
+ - ` topic-create ` - creates topic with consumer in database
29
+ - ` topic-cleanup ` - drops topic in database
30
+ - ` topic-run ` - runs topic workload (publish and consume messages with set RPS)
20
31
21
32
### Run examples with all arguments:
22
33
23
- create:
24
- `python tests/slo/src/ create localhost:2136 /local -t tableName
34
+ ** Table examples:**
35
+
36
+ table-create:
37
+ `python tests/slo/src/ table-create localhost:2136 /local -t tableName
25
38
--min-partitions-count 6 --max-partitions-count 1000 --partition-size 1 -с 1000
26
39
--write-timeout 10000`
27
40
28
- cleanup:
29
- ` python tests/slo/src/ cleanup localhost:2136 /local -t tableName `
41
+ table- cleanup:
42
+ ` python tests/slo/src/ table- cleanup localhost:2136 /local -t tableName `
30
43
31
- run:
32
- `python tests/slo/src/ run localhost:2136 /local -t tableName
33
- --prom-pgw http://prometheus-pushgateway:9091 -report-period 250
44
+ table- run:
45
+ `python tests/slo/src/ table- run localhost:2136 /local -t tableName
46
+ --prom-pgw http://prometheus-pushgateway:9091 -- report-period 250
34
47
--read-rps 1000 --read-timeout 10000
35
48
--write-rps 100 --write-timeout 10000
36
49
--time 600 --shutdown-time 30`
37
50
51
+ ** Topic examples:**
52
+
53
+ topic-create:
54
+ `python tests/slo/src/ topic-create localhost:2136 /local
55
+ --topic-path /local/slo_topic --topic-consumer slo_consumer`
56
+
57
+ topic-cleanup:
58
+ ` python tests/slo/src/ topic-cleanup localhost:2136 /local --topic-path /local/slo_topic `
59
+
60
+ topic-run:
61
+ `python tests/slo/src/ topic-run localhost:2136 /local
62
+ --topic-path /local/slo_topic --topic-consumer slo_consumer
63
+ --prom-pgw http://prometheus-pushgateway:9091 --report-period 250
64
+ --topic-write-rps 50 --topic-read-rps 100
65
+ --topic-write-timeout 5000 --topic-read-timeout 3000
66
+ --time 600 --shutdown-time 30`
67
+
38
68
## Arguments for commands:
39
69
40
- ### create
41
- ` python tests/slo/src/ create <endpoint> <db> [options] `
70
+ ### table- create
71
+ ` python tests/slo/src/ table- create <endpoint> <db> [options] `
42
72
43
73
```
44
74
Arguments:
@@ -61,8 +91,8 @@ Options:
61
91
62
92
```
63
93
64
- ### cleanup
65
- ` python tests/slo/src/ cleanup <endpoint> <db> [options] `
94
+ ### table- cleanup
95
+ ` python tests/slo/src/ table- cleanup <endpoint> <db> [options] `
66
96
67
97
```
68
98
Arguments:
@@ -73,8 +103,8 @@ Options:
73
103
-t --table-name <string> table name to create
74
104
```
75
105
76
- ### run
77
- ` python tests/slo/src/ run <endpoint> <db> [options] `
106
+ ### table- run
107
+ ` python tests/slo/src/ table- run <endpoint> <db> [options] `
78
108
79
109
```
80
110
Arguments:
@@ -100,12 +130,70 @@ Options:
100
130
--write-threads <int> number of threads to use for read requests
101
131
```
102
132
133
+ ### topic-create
134
+ ` python tests/slo/src/ topic-create <endpoint> <db> [options] `
135
+
136
+ ```
137
+ Arguments:
138
+ endpoint YDB endpoint to connect to
139
+ db YDB database to connect to
140
+
141
+ Options:
142
+ --topic-path <string> topic path to create
143
+ --topic-consumer <string> consumer name
144
+ --topic-min-partitions <int> minimum active partitions
145
+ --topic-max-partitions <int> maximum active partitions
146
+ --topic-retention-hours <int> retention period in hours
147
+ ```
148
+
149
+ ### topic-cleanup
150
+ ` python tests/slo/src/ topic-cleanup <endpoint> <db> [options] `
151
+
152
+ ```
153
+ Arguments:
154
+ endpoint YDB endpoint to connect to
155
+ db YDB database to connect to
156
+
157
+ Options:
158
+ --topic-path <string> topic path to drop
159
+ ```
160
+
161
+ ### topic-run
162
+ ` python tests/slo/src/ topic-run <endpoint> <db> [options] `
163
+
164
+ ```
165
+ Arguments:
166
+ endpoint YDB endpoint to connect to
167
+ db YDB database to connect to
168
+
169
+ Options:
170
+ --topic-path <string> topic path
171
+ --topic-consumer <string> consumer name
172
+
173
+ --prom-pgw <string> prometheus push gateway
174
+ --report-period <int> prometheus push period in milliseconds
175
+
176
+ --topic-read-rps <int> read RPS for topics
177
+ --topic-read-timeout <int> read timeout milliseconds for topics
178
+ --topic-write-rps <int> write RPS for topics
179
+ --topic-write-timeout <int> write timeout milliseconds for topics
180
+
181
+ --topic-message-size <int> message size in bytes
182
+ --topic-read-threads <int> number of threads to use for read requests
183
+ --topic-write-threads <int> number of threads to use for write requests
184
+
185
+ --time <int> run time in seconds
186
+ --shutdown-time <int> graceful shutdown time in seconds
187
+ ```
188
+
103
189
## Authentication
104
190
105
191
Workload using [ auth-env] ( https://ydb.yandex-team.ru/docs/reference/ydb-sdk/recipes/auth-env ) for authentication.
106
192
107
193
## What's inside
108
- When running ` run ` command, the program creates three jobs: ` readJob ` , ` writeJob ` , ` metricsJob ` .
194
+
195
+ ### Table workload
196
+ When running ` table-run ` command, the program creates three jobs: ` readJob ` , ` writeJob ` , ` metricsJob ` .
109
197
110
198
- ` readJob ` reads rows from the table one by one with random identifiers generated by writeJob
111
199
- ` writeJob ` generates and inserts rows
@@ -120,13 +208,27 @@ Table have these fields:
120
208
121
209
Primary key: ` ("object_hash", "object_id") `
122
210
211
+ ### Topic workload
212
+ When running ` topic-run ` command, the program creates three jobs: ` readJob ` , ` writeJob ` , ` metricsJob ` .
213
+
214
+ - ` readJob ` reads messages from topic using TopicReader and commits offsets
215
+ - ` writeJob ` generates and publishes messages to topic using TopicWriter
216
+ - ` metricsJob ` periodically sends metrics to Prometheus
217
+
218
+ Messages contain:
219
+ - Sequential message ID
220
+ - Thread identifier
221
+ - Configurable payload size (padded with 'x' characters)
222
+
123
223
## Collected metrics
124
224
- ` oks ` - amount of OK requests
125
225
- ` not_oks ` - amount of not OK requests
126
226
- ` inflight ` - amount of requests in flight
127
227
- ` latency ` - summary of latencies in ms
128
228
- ` attempts ` - summary of amount for request
129
229
230
+ Metrics are collected for both table operations (` read ` , ` write ` ) and topic operations (` read ` , ` write ` ).
231
+
130
232
> You must reset metrics to keep them ` 0 ` in prometheus and grafana before beginning and after ending of jobs
131
233
132
234
## Look at metrics in grafana
0 commit comments