mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-31 05:25:49 +00:00
Build benchmark binary inside container via multi-stage Dockerfile. All-in-one: docker compose run bench.
47 lines
1.0 KiB
YAML
47 lines
1.0 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:17
|
|
environment:
|
|
POSTGRES_USER: smp
|
|
POSTGRES_DB: smp_bench
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
volumes:
|
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U smp -d smp_bench"]
|
|
interval: 2s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
bench:
|
|
build:
|
|
context: ..
|
|
dockerfile: bench/Dockerfile
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
BENCH_PG: "postgresql://smp@postgres/smp_bench"
|
|
BENCH_CLIENTS: "${BENCH_CLIENTS:-5000}"
|
|
BENCH_MINUTES: "${BENCH_MINUTES:-5}"
|
|
command:
|
|
- "--pg"
|
|
- "postgresql://smp@postgres/smp_bench"
|
|
- "--clients"
|
|
- "${BENCH_CLIENTS:-5000}"
|
|
- "--minutes"
|
|
- "${BENCH_MINUTES:-5}"
|
|
- "--timeseries"
|
|
- "/results/timeseries.csv"
|
|
- "+RTS"
|
|
- "-N"
|
|
- "-A16m"
|
|
- "-T"
|
|
- "-RTS"
|
|
volumes:
|
|
- ./results:/results
|
|
|
|
volumes:
|
|
pgdata:
|