diff --git a/dev/local/ch-bench-read/.gitignore b/dev/local/ch-bench-read/.gitignore index b45dd346..a20ce5e3 100644 --- a/dev/local/ch-bench-read/.gitignore +++ b/dev/local/ch-bench-read/.gitignore @@ -1,2 +1,3 @@ record /report.yml +/req.rwq diff --git a/dev/local/ch-bench-read/docker-compose.yml b/dev/local/ch-bench-read/docker-compose.yml index 52c44fe4..b182fc88 100644 --- a/dev/local/ch-bench-read/docker-compose.yml +++ b/dev/local/ch-bench-read/docker-compose.yml @@ -10,9 +10,9 @@ services: - "127.0.0.1:9000:9000" - "127.0.0.1:8123:8123" volumes: - - ./clickhouse.xml:/etc/clickhouse-server/config.d/monitoring.xml + - ./clickhouse.xml:/etc/clickhouse-server/config.d/monitoring.xml:ro healthcheck: - test: ['CMD', 'wget', '--spider', '-q', '127.0.0.1:8123/ping'] + test: ["CMD", "wget", "--spider", "-q", "127.0.0.1:8123/ping"] interval: 1s timeout: 1s retries: 30 @@ -20,9 +20,9 @@ services: prometheus: image: "ghcr.io/go-faster/prom/prometheus" command: - - '--config.file=/etc/prometheus/prometheus.yml' + - "--config.file=/etc/prometheus/prometheus.yml" volumes: - - './prometheus.yml:/etc/prometheus/prometheus.yml' + - "./prometheus.yml:/etc/prometheus/prometheus.yml:ro" restart: unless-stopped oteldb: @@ -49,13 +49,13 @@ services: - GOMAXPROCS=6 - GOMEMLIMIT=1500MiB healthcheck: - test: ['CMD', 'wget', '--spider', '-q', '127.0.0.1:13133/liveness'] + test: ["CMD", "wget", "--spider", "-q", "127.0.0.1:13133/liveness"] interval: 1s timeout: 1s retries: 30 ports: - - "127.0.0.1:9090:9090" # promql - - "127.0.0.1:9010:9010" # pprof + - "127.0.0.1:9090:9090" # promql + - "127.0.0.1:9010:9010" # pprof - "127.0.0.1:19291:19291" # prometheus remote write depends_on: - clickhouse @@ -75,38 +75,24 @@ services: depends_on: - clickhouse - otelproxy: - build: - context: ../../../ - dockerfile: otelproxy.Dockerfile - volumes: - - ./record:/record - environment: - - PROMETHEUS_URL=http://oteldb:9090 - - PROMETHEUS_RECORD=/record/queries.jsonl - - OTEL_LOG_LEVEL=info - - OTEL_METRICS_EXPORTER=none - - OTEL_LOGS_EXPORTER=none - - OTEL_TRACES_EXPORTER=none - - OTEL_RESOURCE_ATTRIBUTES=service.name=go-faster.otelproxy tempo: image: "ghcr.io/go-faster/tempo" - command: [ "-config.file=/etc/tempo.yml" ] + command: ["-config.file=/etc/tempo.yml"] ports: - "127.0.0.1:3200:3200" volumes: - - ./tempo.yml:/etc/tempo.yml + - ./tempo.yml:/etc/tempo.yml:ro # https://opentelemetry.io/docs/collector/installation/#docker-compose otelcol: image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.89.0 volumes: - - ./otelcol.yml:/etc/otelcol-contrib/config.yaml + - ./otelcol.yml:/etc/otelcol-contrib/config.yaml:ro ports: - "127.0.0.1:4317:4317" command: - - '--config' - - '/etc/otelcol-contrib/config.yaml' + - "--config" + - "/etc/otelcol-contrib/config.yaml" grafana: image: "ghcr.io/go-faster/grafana:10.0.0" @@ -122,8 +108,8 @@ services: ports: - "127.0.0.1:3000:3000" volumes: - - ./grafana/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml - - ./grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/default.yml + - ./grafana/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro + - ./grafana/dashboards.yml:/etc/grafana/provisioning/dashboards/default.yml:ro - ./grafana/dashboards:/etc/grafana/dashboards:ro depends_on: - oteldb diff --git a/dev/local/ch-bench-read/run.sh b/dev/local/ch-bench-read/run.sh new file mode 100755 index 00000000..a1c291e1 --- /dev/null +++ b/dev/local/ch-bench-read/run.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +clean_up() { + ARG=$? + echo ">> Stopping" + docker compose down -v + exit $ARG +} +trap clean_up EXIT + +set -e + +echo ">> Setup oteldb locally" +docker compose up -d --remove-orphans --build --force-recreate + +echo ">> Upload benchmark data" +wget -N -O req.rwq https://storage.yandexcloud.net/faster-public/oteldb/req.rwq +go run github.com/go-faster/oteldb/cmd/otelbench promrw replay -i req.rwq + +queries_file="${BENCH_QUERIES:-testdata/node-exporter-selected.promql.yml}" + +echo ">> Warmup" +go run github.com/go-faster/oteldb/cmd/otelbench promql bench \ + -i "$queries_file" \ + --warmup 10 + +echo ">> Benchmark" +OTEL_EXPORTER_OTLP_INSECURE="true" go run github.com/go-faster/oteldb/cmd/otelbench promql bench \ + -i "$queries_file" \ + -o report.yml \ + --trace \ + --allow-empty=false \ + --count 5 \ + --warmup 5 + +echo ">> Done"