@@ -23,38 +23,38 @@ in the spirit of TimescaleDB's Time Series Benchmark Suite (TSBS).
23
23
24
24
## About
25
25
26
- The ` tsperf ` program is a database workload generator including two different domains,
27
- one for writing data and another one for reading.
26
+ The ` tsperf ` program includes both a database workload generator, and a query
27
+ timer. That effectively spans two domains, one for writing data, and another
28
+ one for reading.
28
29
29
- - [ Data generator ] : Generate time series data and feed it into database.
30
+ - [ Data Generator ] : Generate time series data and feed it into database.
30
31
Use ` tsperf write --help ` to explore its options.
31
- - [ Query timer ] : Probe responsiveness of database on the read path.
32
+ - [ Query Timer ] : Probe responsiveness of database on the read path.
32
33
Use ` tsperf read --help ` to explore its options.
33
34
34
35
For the purpose of capacity testing, both domains try to simulate the generation and querying of
35
36
time-series data. As the program is easy to use, it provides instant reward without the need to
36
37
set up a whole data ingestion chain.
37
38
38
- [ Data generator ] : tsperf/write/README.md
39
- [ Query timer ] : tsperf/read/README.md
40
-
41
39
42
40
## Features
43
41
42
+ ### General
44
43
* Generate random data which follows a statistical model to better reflect real world scenarios,
45
44
real world data is almost never truly random.
46
45
* The "steady load"-mode can simulate a constant load of a defined number of messages per second.
47
46
* Ready-made to deploy and scale data generators with Docker containers. In order to maximize
48
- performance, multiple instances of the Data Generator can be run in parallel.
49
- This can be achieved by [ using Kubernetes] ( KUBERNETES.md ) .
47
+ performance, multiple instances of the data generator can be run in parallel.
48
+ This can be achieved by [ parallelizing using Kubernetes] .
50
49
* Metrics are exposed for consumption by Prometheus.
51
- * Data generator features
52
- * Easy to define your own [ schema] ( tsperf/write/README.md#data-generator-schemas ) .
53
- * Full control on how many values will be inserted.
54
- * Scale out to multiple clients is a core concept.
55
- * Huge sets of data can be inserted without creating files as intermediate storage.
56
50
57
- ### Supported databases
51
+ ### Data Generator
52
+ * Capability to [ define your own schema] .
53
+ * Full control on how many values will be inserted.
54
+ * Scale out to multiple clients is a core concept.
55
+ * Huge sets of data can be inserted without creating files as intermediate storage.
56
+
57
+ ### Database Coverage
58
58
* CrateDB
59
59
* InfluxDB
60
60
* Microsoft SQL Server
@@ -64,20 +64,6 @@ set up a whole data ingestion chain.
64
64
* Timestream
65
65
66
66
67
- ## Prior art
68
-
69
- ### TSBS
70
- The [ Time Series Benchmark Suite (TSBS)] is a collection of Go programs that are used to generate
71
- datasets and then benchmark read and write performance of various databases.
72
-
73
- ### cr8 + mkjson
74
- ` mkjson ` combined with ` cr8 insert-json ` makes it easy to generate random entries into a table.
75
- See [ generate data sets using mkjson] for an example how to use ` cr8 ` together with ` mkjson ` .
76
-
77
- [ generate data sets using mkjson ] : https://zignar.net/2020/05/01/generating-data-sets-using-mkjson/
78
- [ Time Series Benchmark Suite (TSBS) ] : https://github.com/timescale/tsbs
79
-
80
-
81
67
## Install
82
68
83
69
### Python package
@@ -87,190 +73,54 @@ pip install --user tsperf
87
73
88
74
### Docker image
89
75
``` shell
90
- docker run -it --rm --network=host tsperf tsperf write --help
76
+ alias tsperf=" docker run -it --rm --network=host tsperf tsperf"
77
+ tsperf --help
91
78
```
92
79
93
-
94
80
## Usage
95
81
96
- This section outlines the usage of ` tsperf ` on different databases. Please note that using Docker
97
- here is just for demonstration purposes. In reality, you will want to run the database workload
98
- against a database instance running on a decently powered machine.
99
-
100
- - For increasing concurrency, try ` --concurrency=8 ` .
101
- - For enabling Prometheus metrics export, try ` --prometheus-enable=true ` and maybe ` --prometheus-listen=0.0.0.0:8000 ` .
102
- - For increasing concurrency and number of iterations when querying, try ` --concurrency=10 --iterations=2000 ` .
103
- - For displaying the list of built-in schemas, run ` tsperf schema --list ` .
104
-
105
-
106
- ### CrateDB
107
- ``` shell
108
- # Run CrateDB
109
- docker run -it --rm --publish=4200:4200 --publish=5432:5432 crate:4.5.1
110
-
111
- # Feed data into CrateDB table.
112
- # Adjust write parameters like `--partition=day --shards=6 --replicas=3`.
113
- tsperf write --adapter=cratedb --schema=tsperf.schema.basic:environment.json
114
- tsperf write --schema=tsperf.schema.basic:environment.json --adapter=cratedb --address=cratedb.example.org:4200
115
-
116
- # Use Docker.
117
- docker run -it --rm --network=host tsperf tsperf write --schema=tsperf.schema.basic:environment.json --adapter=cratedb
118
-
119
- # Query data from CrateDB table.
120
- tsperf read --adapter=cratedb --query=" SELECT * FROM environment LIMIT 10;"
121
- ```
122
-
123
- ### CrateDB+PostgreSQL
124
- ``` shell
125
- # Run CrateDB workload via PostgreSQL protocol.
126
- tsperf write --adapter=cratedbpg --schema=tsperf.schema.basic:environment.json
127
- tsperf read --adapter=cratedbpg --iterations=3000 --query=" SELECT * FROM environment LIMIT 10;"
128
-
129
- # Run PostgreSQL workload on CrateDB.
130
- tsperf write --adapter=postgresql --schema=tsperf.schema.basic:environment.json
131
- tsperf read --adapter=postgresql --username=crate --iterations=3000 --query=" SELECT * FROM environment LIMIT 10;"
132
- ```
133
-
134
-
135
- ### InfluxDB
136
- ``` shell
137
- # Run and configure InfluxDB
138
- docker run -it --rm --publish=8086:8086 influxdb:2.0
139
- influx setup --name=default --username=root --password=12345678 --org=acme --bucket=environment --retention=0 --force
140
- cat /Users/amo/.influxdbv2/configs
141
-
142
- # Configure tsperf
143
- export ADAPTER=influxdb
144
- export ADDRESS=http://localhost:8086/
145
- export INFLUXDB_ORGANIZATION=acme
146
- export INFLUXDB_TOKEN=" X1kHPaXvS...p1IAQ=="
147
-
148
- # Feed data into InfluxDB bucket.
149
- tsperf write --schema=tsperf.schema.basic:environment.json
150
-
151
- # Query data from InfluxDB bucket.
152
- tsperf read --query=' from(bucket:"environment") |> range(start:-2h, stop:2h) |> limit(n: 10)'
153
- ```
154
-
155
- On InfluxDB Cloud, after generating an "All Access Token", configure ` tsperf ` like:
156
- ``` shell
157
- export ADAPTER=influxdb
158
- export ADDRESS=" https://eu-central-1-1.aws.cloud2.influxdata.com/"
159
- export INFLUXDB_ORGANIZATION=a05test6edtest2d
160
- export INFLUXDB_TOKEN=" wpNtestfeNUveYitDLk8Ld47vrSVUTKB_vEaEwWC7qXj_ZqvOwYCRhQTB4EDty3uLFMXWP2C195gtestt4XGFQ=="
161
- ```
162
-
163
-
164
- ### Microsoft SQL Server
165
- ``` shell
166
- # Run Microsoft SQL Server
167
- docker run -it --rm --publish=1433:1433 --env=" ACCEPT_EULA=Y" --env=" SA_PASSWORD=yayRirr3" mcr.microsoft.com/mssql/server:2019-latest
168
- docker exec -it aeba7fdd4d73 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P yayRirr3 -Q " select @@Version"
169
-
170
- # Install the Microsoft ODBC driver for SQL Server
171
- - Visit: https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server
82
+ Please refer to the [ usage] documentation.
172
83
173
- # Configure tsperf
174
- export ADAPTER=mssql
175
84
176
- # Feed data into MSSQL table.
177
- tsperf write --schema=tsperf.schema.basic:environment.json
85
+ ## Prior Art
178
86
179
- # Query data from MSSQL table.
180
- tsperf read --iterations=3000 --query=" SELECT TOP 10 * FROM environment;"
181
- ```
182
-
183
-
184
- ### MongoDB
185
- ``` shell
186
- # Run and configure MongoDB
187
- docker run -it --rm --publish=27017:27017 mongo:4.4
188
-
189
- # Feed data into MongoDB collection.
190
- tsperf write --adapter=mongodb --schema=tsperf.schema.basic:environment.json
191
-
192
- # Query data from MongoDB collection.
193
- tsperf read --adapter=mongodb --schema=tsperf.schema.basic:environment.json
194
-
195
- # For connecting to MongoDB Atlas, use:
196
- export ADDRESS=
" mongodb+srv://username:[email protected] /tsperf?retryWrites=true&w=majority"
197
- ```
198
-
199
-
200
- ### PostgreSQL
201
- ``` shell
202
- # Run PostgreSQL
203
- docker run -it --rm --env=" POSTGRES_HOST_AUTH_METHOD=trust" --publish=5432:5432 postgres:13.3
204
-
205
- # Configure tsperf
206
- export ADAPTER=postgresql
207
-
208
- # Feed data into PostgreSQL table.
209
- tsperf write --schema=tsperf.schema.basic:environment.json
210
-
211
- # Query data from PostgreSQL table.
212
- tsperf read --iterations=3000 --query=" SELECT * FROM environment LIMIT 10;"
213
- ```
214
-
215
-
216
- ### TimescaleDB
217
- ``` shell
218
- # Run TimescaleDB
219
- docker run -it --rm --env=" POSTGRES_HOST_AUTH_METHOD=trust" --publish=5432:5432 timescale/timescaledb:2.3.0-pg13
220
-
221
- # Configure tsperf
222
- export ADAPTER=timescaledb
223
-
224
- # Feed data into TimescaleDB hypertable.
225
- # Adjust write parameters like `--timescaledb-distributed --timescaledb-pgcopy`.
226
- tsperf write --schema=tsperf.schema.basic:environment.json
227
-
228
- # Query data from TimescaleDB hypertable.
229
- tsperf read --iterations=3000 --query=" SELECT * FROM environment LIMIT 10;"
230
- ```
231
-
232
-
233
- ### Timestream
234
- ``` shell
235
- # Run Timestream
236
-
237
- # There is no way to run Amazon Timestream on premises.
238
- # - https://aws.amazon.com/timestream/
239
- # - https://docs.aws.amazon.com/timestream/
240
-
241
- # Configure tsperf
242
- export ADAPTER=timestream
243
- export ADDRESS=ingest-cell1.timestream.us-west-2.amazonaws.com
244
- export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
245
- export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
246
- export AWS_REGION_NAME=us-west-2
87
+ ### cr8 + mkjson
88
+ ` mkjson ` combined with ` cr8 insert-json ` makes it easy to generate random entries into a table.
89
+ See [ generate data sets using mkjson] for an example how to use ` cr8 ` together with ` mkjson ` .
247
90
248
- # Feed data into Timestream table.
249
- tsperf write --schema=tsperf.schema.basic:environment.json
91
+ ### TSBS
92
+ The [ Time Series Benchmark Suite (TSBS)] is a collection of Go programs that are used to generate
93
+ datasets and then benchmark read and write performance of various databases.
250
94
251
- # Query data from Timestream table.
252
- tsperf read --iterations=3000 --query=" SELECT * FROM environment LIMIT 10;"
253
- ```
254
95
96
+ ## Project Information
255
97
256
- ## Contributing
257
- We are always happy to receive code contributions, ideas, suggestions and problem reports from the community.
98
+ ### Contributing
99
+ We are always happy to receive code contributions, ideas, suggestions and
100
+ problem reports from the community.
258
101
259
- So, if you’d like to contribute you’re most welcome. Spend some time taking a look around, locate a bug, design
260
- issue or spelling mistake and then send us a pull request or open an issue on GitHub.
102
+ So, if you’d like to contribute you’re most welcome. Spend some time taking
103
+ a look around, locate a bug, design issue or spelling mistake and then send
104
+ us a pull request or open an issue on GitHub.
261
105
262
106
Thanks in advance for your efforts, we really appreciate any help or feedback.
263
107
264
-
265
- ## Acknowledgements
108
+ ### Acknowledgements
266
109
Thanks to all the contributors who helped to co-create and conceive ` tsperf `
267
110
in one way or another and kudos to all authors of the foundational libraries.
268
111
269
-
270
- ## License
112
+ ### License
271
113
This project is licensed under the terms of the Apache 2.0 license.
272
114
273
115
116
+ [ Data Generator ] : https://tsperf.readthedocs.io/data-generator.html
117
+ [ define your own schema ] : https://tsperf.readthedocs.io/data-generator.html#data-generator-schemas
118
+ [ generate data sets using mkjson ] : https://zignar.net/2020/05/01/generating-data-sets-using-mkjson/
119
+ [ parallelizing using Kubernetes ] : https://tsperf.readthedocs.io/performance.html
120
+ [ Query Timer ] : https://tsperf.readthedocs.io/query-timer.html
121
+ [ Time Series Benchmark Suite (TSBS) ] : https://github.com/timescale/tsbs
122
+ [ Usage ] : https://tsperf.readthedocs.io/usage.html
123
+
274
124
[ Changelog ] : https://github.com/crate/tsperf/blob/main/CHANGES.md
275
125
[ Documentation ] : https://tsperf.readthedocs.io/
276
126
[ Issues ] : https://github.com/crate/tsperf/issues
0 commit comments