Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit cebc212

Browse files
authored
Merge pull request #1015 from grafana/benchmarks-cluster-queries
Benchmarks cluster queries
2 parents 7596fe0 + 2b6a243 commit cebc212

8 files changed

+66
-0
lines changed

benchmarks/cluster-queries/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## cluster-queries benchmark
2+
3+
## goal
4+
5+
realistic query workload to see
6+
where we allocate (and keep in use) significant amounts of memory
7+
8+
in particular for:
9+
1) optimizing pointSlicePool
10+
2) optimizing chunkcache
11+
12+
## running the benchmark
13+
14+
```
15+
./launch.sh docker-cluster
16+
```
17+
18+
wait for stack to be up.
19+
20+
```
21+
./fakemetrics backfill --kafka-mdm-addr localhost:9092 --kafka-mdm-v2=false --offset $((2*366*24))h --period 1800s --speedup 360000 --mpo 500
22+
```
23+
24+
this should complete in about 3 minutes.
25+
load MT dashboard and confirm it ingested data at 200kHz for 3 minutes
26+
27+
when done: in grafana look at `some.id.of.a.metric.{1,72,199,320,438};id=*;some=tag` to confirm data looks good (over 2y)
28+
29+
finally: `./run.sh`
30+
31+
## observations:
32+
33+
* memory usage grows during test but does not release afterwards (!).
34+
in line with cache, but much more than cache reports (~50MB). profile shows ~50~60% of allocations are in chunk cache
35+
36+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GET http://localhost:6061/render?target=some.id.of.a.metric.1*;id=*;some=tag&from=-30s
2+
GET http://localhost:6061/render?target=some.id.of.a.metric.22*;id=*;some=tag&from=-60s
3+
GET http://localhost:6061/render?target=some.id.of.a.metric.33*;id=*;some=tag&from=-1h
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cat alerting-input | vegeta attack -rate 20 -duration 30s > alerting-out
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
4+
function gen_input() {
5+
# we have 500 series and want to select 10 out of them
6+
for i in {1..300};
7+
do
8+
patt="$(($RANDOM % 5))$(($RANDOM % 10))*"
9+
echo "GET http://localhost:6061/render?target=some.id.of.a.metric.$patt;some=tag&from=-2y"
10+
done
11+
}
12+
13+
input=$(gen_input)
14+
echo "$input" | vegeta attack -rate 1 -duration 30s > exploration-out

benchmarks/cluster-queries/run.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# alerting use case: frequent reads of the same, recent data
4+
./run-alerting.sh &
5+
# exploration case: infrequent, random data, longer timeframe
6+
./run-exploration.sh
7+
8+
sleep 3
9+
echo "alerting:"
10+
cat alerting-out | vegeta report
11+
echo "exploration:"
12+
cat exploration-out | vegeta report
File renamed without changes.

0 commit comments

Comments
 (0)