Skip to content

Commit

Permalink
feat(ch-log-bench-read): setup a flow for dump benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Nov 30, 2024
1 parent 2639e7a commit 2f9103e
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 48 deletions.
25 changes: 25 additions & 0 deletions dev/local/ch-log-bench-read/benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

echo ">> Benchmark"
start_time="2024-11-20T00:00:00Z"
end_time="2024-12-01T00:00:00Z"

queries_file="${BENCH_QUERIES:-testdata/logql.yml}"
benchmark_runs="${BENCH_RUNS:-15}"

OTEL_EXPORTER_OTLP_INSECURE="true" go run github.com/go-faster/oteldb/cmd/otelbench logql bench \
--start "$start_time" \
--end "$end_time" \
-i "$queries_file" \
-o report.yml \
--trace \
--allow-empty=false \
--count "$benchmark_runs"

echo ">> Analyze"
go run github.com/go-faster/oteldb/cmd/otelbench logql analyze \
--input report.yml \
--format benchstat >benchstat.report.txt

echo ">> Benchstat"
benchstat benchstat.report.txt
30 changes: 30 additions & 0 deletions dev/local/ch-log-bench-read/benchstat.report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.8312139e+07 ns/op 1.2206e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.8900345e+07 ns/op 9.783e+06 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.5139956e+07 ns/op 8.579e+06 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.6205743e+07 ns/op 7.823e+06 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.6402959e+07 ns/op 8.924e+06 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.6527967e+07 ns/op 1.0031e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.4814553e+07 ns/op 8.509e+06 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 1.8444475e+07 ns/op 1.2428e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 2.9202646e+07 ns/op 1.8075e+07 ch-ns/op 2.4989096e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 2.2234944e+07 ns/op 1.4525e+07 ch-ns/op 2.4989096e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 2.2714624e+07 ns/op 1.2517e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 2.4178972e+07 ns/op 1.5555e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 2.5491585e+07 ns/op 1.6143e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 2.5846677e+07 ns/op 1.3652e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_materialzied_attribute 0 2.6512113e+07 ns/op 1.8816e+07 ch-ns/op 2.9844525e+07 ch-mem-bytes/op 3.114507e+06 ch-read-bytes/op 76487 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.503247173e+09 ns/op 9.484408e+09 ch-ns/op 1.011771776e+09 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.382955518e+09 ns/op 9.363015e+09 ch-ns/op 9.83286662e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.412811186e+09 ns/op 9.393764e+09 ch-ns/op 1.000044544e+09 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.41515843e+09 ns/op 9.391413e+09 ch-ns/op 9.71273619e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.431770611e+09 ns/op 9.41161e+09 ch-ns/op 9.89142539e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.460823775e+09 ns/op 9.44376e+09 ch-ns/op 9.61471771e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.479301565e+09 ns/op 9.459976e+09 ch-ns/op 1.046409107e+09 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.497708279e+09 ns/op 9.476645e+09 ch-ns/op 1.001103881e+09 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.697009268e+09 ns/op 9.678494e+09 ch-ns/op 9.98799275e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.542321943e+09 ns/op 9.524182e+09 ch-ns/op 9.63434376e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.545557368e+09 ns/op 9.526367e+09 ch-ns/op 9.94263275e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.582909681e+09 ns/op 9.560424e+09 ch-ns/op 1.004850493e+09 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.610037707e+09 ns/op 9.589673e+09 ch-ns/op 9.54908227e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.651464196e+09 ns/op 9.631605e+09 ch-ns/op 1.035748955e+09 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
BenchmarkLogQL/Lookup_by_regular_attribute 0 9.681995019e+09 ns/op 9.661066e+09 ch-ns/op 9.86583991e+08 ch-mem-bytes/op 1.0529367877e+10 ch-read-bytes/op 6.3630022e+07 ch-read-rows/op
43 changes: 0 additions & 43 deletions dev/local/ch-log-bench-read/run.sh

This file was deleted.

14 changes: 14 additions & 0 deletions dev/local/ch-log-bench-read/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

echo ">> Setup oteldb locally"
docker compose up -d --remove-orphans --build

DUMP_DIR="${DUMP_DIR:-/tmp/slowdump}"

echo ">> Upload benchmark data"
go run github.com/go-faster/oteldb/cmd/otelbench dump restore \
--truncate \
--database default \
--input "${DUMP_DIR}"
10 changes: 5 additions & 5 deletions dev/local/ch-log-bench-read/testdata/logql.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
range:
- title: Failed POST requests
- title: Lookup by materialzied attribute
query: |-
{http_method="POST"} |= "Error"
series:
- title: All POST series
match: ['{http_method="POST"}']
{level!="DEBUG", service_name="go-faster.oteldb"}
- title: Lookup by regular attribute
query: |-
{operationName="SearchTagValuesV2"}

0 comments on commit 2f9103e

Please sign in to comment.