-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.bench.yml
More file actions
144 lines (135 loc) · 5.14 KB
/
Copy pathdocker-compose.bench.yml
File metadata and controls
144 lines (135 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: relier-bench
# =============================================================================
# Isolated benchmark environment — runs entirely inside Docker so results
# are not distorted by Windows-only solo pool or by competing dev workers.
#
# Default run (500 tasks, synthetic 0.5 s tasks):
# docker compose -f docker-compose.bench.yml up --build
#
# Scale to 10k tasks:
# BENCH_BATCH_SIZE=10000 docker compose -f docker-compose.bench.yml up --build
#
# Scale to 100k tasks (add more worker replicas first):
# BENCH_BATCH_SIZE=100000 BENCH_WORKER_CONCURRENCY=8 \
# docker compose -f docker-compose.bench.yml up --build --scale bench-runner=1
#
# Grafana: http://localhost:3001 (user: admin / bench)
# Prometheus: http://localhost:9091
# Redis (isolated): localhost:6380
# =============================================================================
x-bench-env: &bench-env
RELIER_REDIS_URL: redis://bench-redis:6379/0
BENCH_SYNTHETIC: "1"
BENCH_SYNTHETIC_SLEEP: "${BENCH_SYNTHETIC_SLEEP:-0.5}"
BENCH_BATCH_SIZE: "${BENCH_BATCH_SIZE:-500}"
# Disable OTel in bench the bench measures wall-clock time, not OTEL traces.
RELIER_OTEL_ENABLED: "false"
services:
# ===========================================================================
# Infrastructure — isolated Redis, never shared with the dev stack
# ===========================================================================
bench-redis:
image: redis:7.2-alpine
container_name: bench-redis
# Minimal inline config: noeviction + AOF, no external redis.conf needed.
command: >
redis-server
--maxmemory-policy noeviction
--appendonly yes
--save 60 1
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 2s
retries: 15
networks:
- bench-net
# ===========================================================================
# Observability
# ===========================================================================
redis-exporter:
image: oliver006/redis_exporter:latest
container_name: bench-redis-exporter
command:
- "--redis.addr=redis://bench-redis:6379"
- "--check-keys=default,high_priority,low_priority,re-queue,vanilla,vanilla_acks_late,rl:m:global:success,rl:m:global:failed,rl:m:global:resurrected,bench:relier:embed_exec,bench:relier:noop_exec,bench:relier:summary_exec,bench:relier:delivery_done,bench:relier:oom_done,bench:relier:oom_exec,bench:vanilla:embed_exec,bench:vanilla:noop_exec,bench:vanilla:delivery_done,bench:vanilla:oom_done,bench:vanilla_acks_late:delivery_done,bench:vanilla_acks_late:total_exec,bench:relier:phoenix_load_started,bench:relier:phoenix_load_done,bench:cold_start:p50_ms,bench:cold_start:p99_ms"
ports:
- "9121:9121"
depends_on:
bench-redis:
condition: service_healthy
networks:
- bench-net
prometheus:
image: prom/prometheus:v2.52.0
container_name: bench-prometheus
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=2h"
- "--web.enable-lifecycle"
volumes:
- ./bench/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- bench-prometheus-data:/prometheus
ports:
- "9091:9090"
depends_on:
- redis-exporter
networks:
- bench-net
grafana:
image: grafana/grafana:11.0.0
container_name: bench-grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: bench
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
GF_USERS_DEFAULT_THEME: dark
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/bench-overview.json
volumes:
- ./bench/grafana/provisioning:/etc/grafana/provisioning:ro
- ./bench/grafana/dashboards:/var/lib/grafana/dashboards:ro
- bench-grafana-data:/var/lib/grafana
ports:
# Port 3001 avoids conflicting with dev Grafana on 3000.
- "3001:3000"
depends_on:
- prometheus
networks:
- bench-net
# ===========================================================================
# Bench runner — manages all worker subprocesses internally.
#
# The bench spawns, kills, and replaces workers as part of its test protocol
# (OOM simulation, delivery-rate crash testing). All subprocesses run inside
# this container.
# ===========================================================================
bench-runner:
build:
context: .
dockerfile: Dockerfile.bench
container_name: bench-runner
command: python -m bench.bench --synthetic
environment:
<<: *bench-env
volumes:
# Mount bench source live so you can edit bench tasks without rebuilding.
- ./bench:/app/bench:ro
- ./src:/app/src:ro
# Results land here inspect on the host after the run.
- ./bench-results:/app/bench-results
depends_on:
bench-redis:
condition: service_healthy
networks:
- bench-net
# bench-runner exits when the bench finishes; don't restart it.
restart: "no"
networks:
bench-net:
driver: bridge
volumes:
bench-prometheus-data:
bench-grafana-data: