docker-compose.yml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. # docker-compose.yml — single-host M0 stack.
  2. # Run: docker compose up -d
  3. # Then: see M0_VERIFICATION.md for the loadgen smoke test.
  4. #
  5. # Port conventions (project rule):
  6. # - app HTTP services: 8800–8899 (ingestd/routerd/deliverd-fcm/deliverd-telegram/telegramd/admind/loadgen/faketgmd)
  7. # - canonical ports stay (5432 postgres, 4222 nats, 6379 redis,
  8. # 1883 mqtt, 9090 prometheus, 3000 grafana, etc.)
  9. services:
  10. # ── Data tier ────────────────────────────────────────────────────
  11. postgres:
  12. image: timescale/timescaledb:latest-pg16
  13. environment:
  14. POSTGRES_USER: ba
  15. POSTGRES_PASSWORD: ba
  16. POSTGRES_DB: ba
  17. # No host port mapping: a host-local postgres is already on
  18. # :5432. The app services reach this one via the docker network
  19. # DNS name 'postgres'. Use `docker compose exec postgres psql ...`
  20. # to talk to it from the host.
  21. expose: ["5432"]
  22. volumes:
  23. - pgdata:/var/lib/postgresql/data
  24. healthcheck:
  25. test: ["CMD-SHELL", "pg_isready -U ba"]
  26. interval: 5s
  27. timeout: 3s
  28. retries: 10
  29. redis:
  30. image: redis:7-alpine
  31. # No host port mapping: a host-local redis is on :6379. App
  32. # services reach this one via docker DNS 'redis'.
  33. expose: ["6379"]
  34. healthcheck:
  35. test: ["CMD", "redis-cli", "ping"]
  36. interval: 5s
  37. timeout: 3s
  38. retries: 10
  39. nats:
  40. image: nats:2.10-alpine
  41. # -js : JetStream enabled
  42. # -m 8222 : HTTP monitoring port
  43. # -c /etc/nats/nats.conf : load the JetStream config from
  44. # a file. 2.10 does not expose
  45. # max_file_store / max_mem_store as
  46. # CLI flags; they have to come from
  47. # a .conf. The config also sets
  48. # store_dir. See deploy/nats/nats.conf
  49. # and M11_NATS_INVESTIGATION.md.
  50. command: ["-js", "-m", "8222", "-c", "/etc/nats/nats.conf"]
  51. ports: ["4222:4222", "8222:8222"] # 8222 is the monitoring HTTP
  52. volumes:
  53. - natsdata:/data
  54. - ./deploy/nats/nats.conf:/etc/nats/nats.conf:ro
  55. healthcheck:
  56. test: ["CMD", "wget", "-qO-", "http://localhost:8222/healthz"]
  57. interval: 5s
  58. timeout: 3s
  59. retries: 20
  60. emqx:
  61. image: emqx/emqx:5.10.4
  62. ports: ["1883:1883", "18083:18083"] # MQTT + admin UI
  63. volumes:
  64. # M4: per-company ACL + auth bootstrap. acl.conf is read on
  65. # SIGHUP; the auth CSV is read on first boot. M11 promotes
  66. # this to a Postgres-backed authentication chain.
  67. - ./deploy/emqx/acl.conf:/opt/emqx/etc/acl.conf:ro
  68. - ./deploy/emqx/auth-built-in-db-bootstrap.csv:/opt/emqx/etc/auth-built-in-db-bootstrap.csv:ro
  69. # EMQX 5.x prefers env-var config over emqx.conf. The HOCON
  70. # path is emqx.conf → base.hocon → cluster.hocon → env vars
  71. # (highest precedence). The double-underscore separator in
  72. # env-var names maps to nested HOCON keys.
  73. environment:
  74. # Built-in-db authentication (one chain, password_based, plain)
  75. EMQX_AUTHENTICATION__1__BACKEND: "built_in_database"
  76. EMQX_AUTHENTICATION__1__MECHANISM: "password_based"
  77. EMQX_AUTHENTICATION__1__USER_ID_TYPE: "username"
  78. EMQX_AUTHENTICATION__1__PASSWORD_HASH_ALGORITHM__NAME: "plain"
  79. EMQX_AUTHENTICATION__1__PASSWORD_HASH_ALGORITHM__SALT_POSITION: "disable"
  80. # File-based authorization, default-deny
  81. EMQX_AUTHORIZATION__NO_MATCH: "deny"
  82. EMQX_AUTHORIZATION__DENY_ACTION: "disconnect"
  83. EMQX_AUTHORIZATION__SOURCES__1__TYPE: "file"
  84. EMQX_AUTHORIZATION__SOURCES__1__ENABLE: "true"
  85. EMQX_AUTHORIZATION__SOURCES__1__PATH: "/opt/emqx/etc/acl.conf"
  86. healthcheck:
  87. # The original `echo > /dev/tcp/...` ran under sh on
  88. # Debian-based EMQX and reported unhealthy even when the
  89. # broker was fine. Switch to `bash -c` and a TCP probe.
  90. test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/1883"]
  91. interval: 10s
  92. timeout: 5s
  93. retries: 20
  94. clickhouse:
  95. image: clickhouse/clickhouse-server:24-alpine
  96. ports: ["8123:8123", "9000:9000"]
  97. volumes:
  98. - chdata:/var/lib/clickhouse
  99. ulimits:
  100. nofile: { soft: 262144, hard: 262144 }
  101. # ── App tier ─────────────────────────────────────────────────────
  102. ingestd:
  103. build: .
  104. command: ["/app/ingestd"]
  105. environment:
  106. BA_ENV: dev
  107. BA_HTTP_ADDR: ":8800"
  108. BA_NATS_URL: nats://nats:4222
  109. BA_REDIS_URL: redis://redis:6379/0
  110. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  111. BA_INGESTD_SOURCES: "acme-001:acme-001-prom:s3cret-acme-001,acme-002:acme-002-prom:s3cret-acme-002,globex-002:grafana:s3cret-globex"
  112. BA_INGESTD_RATE_LIMIT_PER_SOURCE: "20000"
  113. BA_INGESTD_RATE_LIMIT_PER_COMPANY: "10000"
  114. # M4: MQTT subscriber. ingestd subscribes to ba/+/+/incoming
  115. # with the dedicated `ingestd` user. The auth file lists
  116. # this user (password "ingestd-broker-only") so EMQX's
  117. # built-in-db authenticates the connection.
  118. BA_INGESTD_MQTT_BROKER: "tcp://emqx:1883"
  119. BA_INGESTD_MQTT_USERNAME: "ingestd"
  120. BA_INGESTD_MQTT_PASSWORD: "ingestd-broker-only"
  121. BA_INGESTD_MQTT_SUBSCRIBE: "ba/+/+/incoming"
  122. # M5: WebSocket ingest + live tail. TAIL_TOKEN gates the
  123. # /v1/tail/ws endpoint; a static token is fine for the
  124. # dev path; M11 swaps for JWT.
  125. BA_INGESTD_TAIL_TOKEN: "tail-dev-token-please-change-in-prod"
  126. BA_INGESTD_MAX_CONCURRENT_PER_IP: "32"
  127. BA_INGESTD_DEDUPE_TTL_SECONDS: "300"
  128. # M9 layer 6: circuit breaker (trips after 5 failures in 10s, 30s open)
  129. BA_INGESTD_CB_FAILURE_THRESHOLD: "5"
  130. BA_INGESTD_CB_FAILURE_WINDOW_SECS: "10"
  131. BA_INGESTD_CB_OPEN_DURATION_SECS: "30"
  132. BA_INGESTD_CB_MAX_HALF_OPEN: "1"
  133. # M9 layer 7: quarantine (bans source at 100 hits/5min for 10min)
  134. BA_INGESTD_QUARANTINE_HITS_THRESHOLD: "100"
  135. BA_INGESTD_QUARANTINE_WINDOW_SECONDS: "300"
  136. BA_INGESTD_QUARANTINE_DURATION_SECONDS: "600"
  137. # M13a W4: JWT gate for the /v1/admin/ingest route.
  138. # Shares the secret with authd. Set to empty string to
  139. # disable the admin route (back to M11 behavior).
  140. BA_INGESTD_AUTHD_JWT_SECRET: "${BA_AUTHD_JWT_SECRET:-}"
  141. BA_AUTHD_ISSUER: "broad-announce"
  142. ports: ["8800:8800"]
  143. depends_on:
  144. nats: { condition: service_healthy }
  145. redis: { condition: service_healthy }
  146. postgres: { condition: service_healthy }
  147. emqx: { condition: service_healthy }
  148. routerd:
  149. build: .
  150. command: ["/app/routerd"]
  151. environment:
  152. BA_ENV: dev
  153. BA_HTTP_ADDR: ":8801"
  154. BA_NATS_URL: nats://nats:4222
  155. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  156. # M6.5: router-level dedupe collapse window. A burst of
  157. # identical alerts is held for up to this many ms, then
  158. # a single delivery is fanned out with the final
  159. # dedupe_count. A continuous stream re-flushes every
  160. # DedupeFlushMs.
  161. BA_ROUTERD_DEDUPE_FLUSH_MS: "2000"
  162. ports: ["8801:8801"]
  163. depends_on:
  164. nats: { condition: service_healthy }
  165. postgres: { condition: service_healthy }
  166. deliverd-fcm:
  167. build: .
  168. command: ["/app/deliverd-fcm"]
  169. environment:
  170. BA_ENV: dev
  171. BA_HTTP_ADDR: ":8802"
  172. BA_NATS_URL: nats://nats:4222
  173. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  174. BA_FAKECMD_URL: "http://fakefcmd:8820"
  175. # M8: in-process retry. Defaults match
  176. # internal/retry.Default() — 10 attempts, base
  177. # 100ms, cap 2s, total budget 30s. Tuned to
  178. # terminate in ~12s for a fully failing target
  179. # so a single misbehaving source can't tie up a
  180. # consumer.
  181. BA_DELIVERD_MAX_ATTEMPTS: "10"
  182. BA_DELIVERD_RETRY_BASE_MS: "100"
  183. BA_DELIVERD_RETRY_MAX_MS: "2000"
  184. BA_DELIVERD_RETRY_BUDGET_MS: "30000"
  185. ports: ["8802:8802"]
  186. depends_on:
  187. nats: { condition: service_healthy }
  188. postgres: { condition: service_healthy }
  189. fakefcmd: { condition: service_started }
  190. deliverd-telegram:
  191. build: .
  192. command: ["/app/deliverd-telegram"]
  193. environment:
  194. BA_ENV: dev
  195. BA_HTTP_ADDR: ":8821"
  196. BA_NATS_URL: nats://nats:4222
  197. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  198. BA_TELEGRAM_BOT_TOKEN: "fake-tg-bot-token-acme-001"
  199. BA_TELEGRAM_FAKE_URL: "http://faketgmd:8830"
  200. # M8: same retry knobs as deliverd-fcm.
  201. BA_DELIVERD_MAX_ATTEMPTS: "10"
  202. BA_DELIVERD_RETRY_BASE_MS: "100"
  203. BA_DELIVERD_RETRY_MAX_MS: "2000"
  204. BA_DELIVERD_RETRY_BUDGET_MS: "30000"
  205. ports: ["8821:8821"]
  206. depends_on:
  207. nats: { condition: service_healthy }
  208. postgres: { condition: service_healthy }
  209. faketgmd: { condition: service_started }
  210. telegramd:
  211. build: .
  212. command: ["/app/telegramd"]
  213. environment:
  214. BA_ENV: dev
  215. BA_HTTP_ADDR: ":8822"
  216. BA_NATS_URL: nats://nats:4222
  217. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  218. BA_TELEGRAM_FAKE_URL: "http://faketgmd:8830"
  219. ports: ["8822:8822"]
  220. depends_on:
  221. nats: { condition: service_healthy }
  222. postgres: { condition: service_healthy }
  223. faketgmd: { condition: service_started }
  224. faketgmd:
  225. build: .
  226. command: ["/app/faketgmd", "--addr", ":8830", "--timeout", "5"]
  227. ports: ["8830:8830"]
  228. fakefcmd:
  229. build: .
  230. command: ["/app/fakefcmd", "--addr", ":8820"]
  231. ports: ["8820:8820"]
  232. healthcheck:
  233. test: ["CMD", "wget", "-qO-", "http://localhost:8820/health"]
  234. interval: 5s
  235. timeout: 3s
  236. retries: 10
  237. seed:
  238. build: .
  239. command: ["/app/seed"]
  240. environment:
  241. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  242. BA_MIGRATIONS_DIR: /migrations
  243. volumes:
  244. - ./migrations:/migrations:ro
  245. depends_on:
  246. postgres: { condition: service_healthy }
  247. admind:
  248. build: .
  249. command: ["/app/admind"]
  250. environment:
  251. BA_ENV: dev
  252. BA_HTTP_ADDR: ":8803"
  253. BA_NATS_URL: nats://nats:4222
  254. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  255. # M8: admind connects to NATS to publish DLQ
  256. # replays back onto the deliveries.<chan>.<co>
  257. # subject. The HTTPAddr serves /v1/ping, /v1/dlq*,
  258. # /dlq, /health, /metrics.
  259. # M13a W4: enable the JWT gate by sharing the authd secret.
  260. BA_AUTHD_JWT_SECRET: "${BA_AUTHD_JWT_SECRET:?BA_AUTHD_JWT_SECRET must be set (see scripts/generate-jwt-secret.sh)}"
  261. BA_AUTHD_ISSUER: "broad-announce"
  262. ports: ["8803:8803"]
  263. depends_on:
  264. nats: { condition: service_healthy }
  265. postgres: { condition: service_healthy }
  266. authd: { condition: service_healthy }
  267. # M13a: multi-tenant auth IdP. Issues JWTs and stores
  268. # refresh tokens in Postgres. Other services share
  269. # BA_AUTHD_JWT_SECRET with this one to verify tokens.
  270. authd:
  271. build: .
  272. command: ["/app/authd"]
  273. environment:
  274. BA_ENV: dev
  275. BA_AUTHD_HTTP_ADDR: ":8804"
  276. BA_AUTHD_ISSUER: "broad-announce"
  277. BA_AUTHD_JWT_SECRET: "${BA_AUTHD_JWT_SECRET:?BA_AUTHD_JWT_SECRET must be set (see scripts/generate-jwt-secret.sh)}"
  278. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  279. # M13a W1: dev-only flag that lets authd generate a
  280. # secret on first run if BA_AUTHD_JWT_SECRET is unset.
  281. # In production this MUST be unset; the secret comes
  282. # from a sealed-secret or KMS.
  283. BA_AUTHD_ALLOW_GENERATED_SECRET: "1"
  284. BA_AUTHD_SECRET_FILE: /var/run/broad-announce/authd.jwt
  285. ports: ["8804:8804"]
  286. volumes:
  287. - authd-data:/var/run/broad-announce
  288. depends_on:
  289. postgres: { condition: service_healthy }
  290. archiverd:
  291. build: .
  292. command: ["/app/archiverd"]
  293. environment:
  294. BA_ENV: dev
  295. BA_HTTP_ADDR: ":8805"
  296. BA_POSTGRES_DSN: postgres://ba:ba@postgres:5432/ba?sslmode=disable
  297. # M7: archiver cadence + retention cutoff. The
  298. # Timescale retention policy does the same at 7d;
  299. # the archiver just runs ahead so ClickHouse has
  300. # the data before TS drops it.
  301. BA_ARCHIVERD_RUN_EVERY_SECONDS: "3600"
  302. BA_ARCHIVERD_OLDER_THAN_HOURS: "168"
  303. BA_ARCHIVERD_BATCH_SIZE: "10000"
  304. BA_ARCHIVERD_CLICKHOUSE_URL: "http://clickhouse:8123"
  305. ports: ["8805:8805"]
  306. depends_on:
  307. postgres: { condition: service_healthy }
  308. clickhouse: { condition: service_started }
  309. # ── Observability ────────────────────────────────────────────────
  310. prometheus:
  311. image: prom/prometheus:latest
  312. command:
  313. - --config.file=/etc/prometheus/prometheus.yml
  314. volumes:
  315. - ./deploy/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
  316. # F2: alert rules (NATS resource limits, ingestd publish-path health).
  317. - ./deploy/prometheus/rules:/etc/prometheus/rules:ro
  318. ports: ["9090:9090"]
  319. depends_on: [ingestd, routerd, deliverd-fcm, deliverd-telegram, telegramd, admind]
  320. grafana:
  321. image: grafana/grafana:latest
  322. # :3000 is held by gogs (git3) on this host. Map to :3001
  323. # on the host, keep :3000 internal. M0 ports convention
  324. # says canonical ports stay; the host-port override is a
  325. # one-line exception, fully isolated to grafana.
  326. ports: ["3001:3000"]
  327. environment:
  328. GF_SECURITY_ADMIN_USER: admin
  329. GF_SECURITY_ADMIN_PASSWORD: admin
  330. GF_SECURITY_DISABLE_LOGIN_FORM: "false"
  331. # M9: provisioning paths for dashboards + datasources.
  332. GF_PATHS_PROVISIONING: /etc/grafana/provisioning
  333. GF_DASHBOARDS_ENABLED: "true"
  334. volumes:
  335. - ./deploy/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources:ro
  336. - ./deploy/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
  337. - ./deploy/grafana/provisioning/dashboards/broad-announce-overview.json:/var/lib/grafana/dashboards/broad-announce-overview.json:ro
  338. depends_on: [prometheus]
  339. # ── Loadgen (one-shot smoke profile) ────────────────────
  340. loadgen-http:
  341. build: .
  342. command:
  343. - /app/loadgen-http
  344. - --target=http://ingestd:8800
  345. - --api-key=acme-001:prom-prod:s3cret-acme
  346. - --mode=normal
  347. - --rate=50
  348. - --duration=30s
  349. - --metrics=:8891
  350. - --instance=loadgen-http
  351. - --cluster-id=smoke
  352. profiles: ["loadgen"]
  353. depends_on:
  354. ingestd: { condition: service_started }
  355. # M10: 3-instance cluster hitting 5k/s. Each instance does ~1.7k/s.
  356. # Per-company cap is 10k/s, so 3 × 1.7k = 5.1k is safe.
  357. # Use `docker compose --profile loadgen-m10 up -d` to bring up all 3.
  358. loadgen-http-1:
  359. build: .
  360. command:
  361. - /app/loadgen-http
  362. - --target=http://ingestd:8800
  363. - --api-key=acme-001:prom-prod:s3cret-acme-001
  364. - --mode=normal
  365. - --rate=1700
  366. - --duration=10m
  367. - --ramp-up=30s
  368. - --metrics=:8891
  369. - --instance=loadgen-http-1
  370. - --cluster-id=m10
  371. profiles: ["loadgen-m10"]
  372. depends_on:
  373. ingestd: { condition: service_started }
  374. loadgen-http-2:
  375. build: .
  376. command:
  377. - /app/loadgen-http
  378. - --target=http://ingestd:8800
  379. - --api-key=acme-002:prom-prod:s3cret-acme-002
  380. - --mode=normal
  381. - --rate=1700
  382. - --duration=10m
  383. - --ramp-up=30s
  384. - --metrics=:8891
  385. - --instance=loadgen-http-2
  386. - --cluster-id=m10
  387. profiles: ["loadgen-m10"]
  388. depends_on:
  389. ingestd: { condition: service_started }
  390. loadgen-http-3:
  391. build: .
  392. command:
  393. - /app/loadgen-http
  394. - --target=http://ingestd:8800
  395. - --api-key=acme-003:prom-prod:s3cret-acme-003
  396. - --mode=normal
  397. - --rate=1700
  398. - --duration=10m
  399. - --ramp-up=30s
  400. - --metrics=:8891
  401. - --instance=loadgen-http-3
  402. - --cluster-id=m10
  403. profiles: ["loadgen-m10"]
  404. depends_on:
  405. ingestd: { condition: service_started }
  406. # M10 W4: Rogue loadgen — same company+source as loadgen-http-1 but
  407. # firing at 10× the per-source cap (100/s). Simulates a compromised source
  408. # at 1000/s. Per-source limiter drops 900/s (429); other companies stay clean.
  409. # NOT started by default with --profile loadgen-m10; spawned by step3_runaway_test().
  410. loadgen-http-4:
  411. build: .
  412. command:
  413. - /app/loadgen-http
  414. - --target=http://ingestd:8800
  415. - --api-key=acme-001:prom-prod:s3cret-acme-001
  416. - --mode=normal
  417. - --rate=1000
  418. - --duration=10m
  419. - --ramp-up=10s
  420. - --metrics=:8891
  421. - --instance=loadgen-http-4
  422. - --cluster-id=m10
  423. profiles: ["loadgen-m10"]
  424. depends_on:
  425. ingestd: { condition: service_started }
  426. # M11 W4: gRPC loadgen — 2-instance cluster at 10k/s total.
  427. # Each instance opens 8 parallel streams (workers) at 5k/s each.
  428. # Use: docker compose --profile loadgen-grpc up -d
  429. loadgen-grpc-1:
  430. build: .
  431. command:
  432. - /app/loadgen-grpc
  433. - --target=ingestd:9090
  434. - --api-key=acme-001:acme-001-prom:s3cret-acme-001
  435. - --rate=8000
  436. - --workers=16
  437. - --dedupe-pct=0
  438. - --duration=15m
  439. - --metrics=:8892
  440. - --instance=loadgen-grpc-1
  441. - --cluster-id=m11
  442. profiles: ["loadgen-grpc"]
  443. depends_on:
  444. ingestd: { condition: service_started }
  445. loadgen-grpc-2:
  446. build: .
  447. command:
  448. - /app/loadgen-grpc
  449. - --target=ingestd:9090
  450. - --api-key=acme-002:acme-002-prom:s3cret-acme-002
  451. - --rate=8000
  452. - --workers=16
  453. - --dedupe-pct=0
  454. - --duration=15m
  455. - --metrics=:8892
  456. - --instance=loadgen-grpc-2
  457. - --cluster-id=m11
  458. profiles: ["loadgen-grpc"]
  459. depends_on:
  460. ingestd: { condition: service_started }
  461. # M10-bench: delivery tier stubbed with deliverd-bench (no-op).
  462. # No FCM, no Telegram, no Postgres writes — just consume and ACK.
  463. # Allows broker+router ceiling testing at 50k/s without burning FCM credits.
  464. deliverd-bench:
  465. build: .
  466. command: ["/app/deliverd-bench"]
  467. environment:
  468. BA_ENV: dev
  469. BA_NATS_URL: nats://nats:4222
  470. profiles: ["bench"]
  471. depends_on:
  472. nats: { condition: service_healthy }
  473. # 10-instance loadgen cluster for 50k/s bench (5 × 5k instances × 2 = 50k).
  474. # Split across 2 host machines in production; on docker-compose single-host
  475. # we run 10 instances at 5k/s each for a total of 50k/s.
  476. loadgen-bench-1:
  477. build: .
  478. command:
  479. - /app/loadgen-http
  480. - --target=http://ingestd:8800
  481. - --api-key=acme-bench:prom-bench:s3cret-bench
  482. - --mode=normal
  483. - --rate=5000
  484. - --duration=5m
  485. - --ramp-up=15s
  486. - --metrics=:8891
  487. - --instance=loadgen-bench-1
  488. - --cluster-id=m10-bench
  489. profiles: ["bench"]
  490. depends_on:
  491. ingestd: { condition: service_started }
  492. loadgen-bench-2:
  493. build: .
  494. command:
  495. - /app/loadgen-http
  496. - --target=http://ingestd:8800
  497. - --api-key=acme-bench:prom-bench:s3cret-bench
  498. - --mode=normal
  499. - --rate=5000
  500. - --duration=5m
  501. - --ramp-up=15s
  502. - --metrics=:8891
  503. - --instance=loadgen-bench-2
  504. - --cluster-id=m10-bench
  505. profiles: ["bench"]
  506. depends_on:
  507. ingestd: { condition: service_started }
  508. volumes:
  509. pgdata: {}
  510. natsdata: {}
  511. chdata: {}
  512. authd-data: {}