-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.env.example
More file actions
87 lines (72 loc) · 4.27 KB
/
Copy path.env.example
File metadata and controls
87 lines (72 loc) · 4.27 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
# =============================================================================
# TradeBench Environment Configuration
# =============================================================================
# Copy this file to .env and adjust values for your environment.
#
# TWO ENVIRONMENTS:
# local-dev → Single machine (Docker Desktop / laptop). Use the "local-dev"
# values shown in comments. Lower bot counts, relaxed scoring.
# production → Multi-host / Kubernetes. Use the values set below as defaults.
# =============================================================================
# ── Postgres ──────────────────────────────────────────────────
POSTGRES_DSN=postgres://bench:bench@postgres:5432/bench
# ── Redis ─────────────────────────────────────────────────────
REDIS_ADDR=redis:6379
# ── Sandbox Engine ────────────────────────────────────────────
SANDBOX_MAX_CONCURRENT=10
SANDBOX_BUILD_TIMEOUT=120
SANDBOX_HEALTH_TIMEOUT=30
# TTL in seconds before an idle container is force-removed.
# 1800 = 30 min. Reduce if orphaned containers accumulate locally.
SANDBOX_CONTAINER_TTL=1800
BENCH_NET_NAME=tradebench_bench-net
# ── Bot Fleet ─────────────────────────────────────────────────
# Per-request deadline. 500ms is the production standard.
# local-dev: raise to 2000 if Docker Desktop inter-container latency causes
# excessive timeouts and you want to isolate engine correctness from infra noise.
BOT_TIMEOUT_MS=500
# ── Load Profile Phases ───────────────────────────────────────
# Duration is in seconds. Count is concurrent goroutine bots.
# local-dev values (for a laptop / Docker Desktop) shown in comments.
BOT_WARMUP_DURATION=20
BOT_WARMUP_COUNT=50 # local-dev: 5
BOT_RAMP_DURATION=30
BOT_RAMP_COUNT=200 # local-dev: 20
BOT_SUSTAINED_DURATION=60
BOT_SUSTAINED_COUNT=500 # local-dev: 50
BOT_SPIKE_DURATION=20
BOT_SPIKE_COUNT=1000 # local-dev: 100
BOT_DRAIN_DURATION=20
# ── Scoring Ceilings ──────────────────────────────────────────
# CRITICAL: These two values define the scoring formula normalization.
# They MUST be calibrated to your bot fleet size, or scores will be
# permanently capped below 1.0.
#
# throughputScore = min(actual_TPS / BOT_TARGET_TPS, 1.0)
# latencyScore = max(0.0, 1.0 - p99_ms / BOT_MAX_P99_MS)
#
# Rule of thumb:
# BOT_TARGET_TPS ≈ BOT_SUSTAINED_COUNT × expected_requests_per_bot_per_sec
# BOT_MAX_P99_MS ≈ BOT_TIMEOUT_MS (a p99 at the timeout ceiling = score of 0)
#
# Production (500 sustained bots → ~1000 TPS expected from a good engine):
BOT_TARGET_TPS=1000
BOT_MAX_P99_MS=500
#
# local-dev (50 sustained bots → ~250 TPS is a realistic ceiling on Docker Desktop):
# BOT_TARGET_TPS=250
# BOT_MAX_P99_MS=500
# ── Telemetry ─────────────────────────────────────────────────
# Aggregation window in seconds. Scores are computed and published every N seconds.
# Lower = more real-time leaderboard updates, higher = more stable scores.
TELEMETRY_WINDOW_SEC=10
# ── API Gateway ───────────────────────────────────────────────
# 50MB upload limit for ZIP submissions.
UPLOAD_MAX_BYTES=52428800
# How often the SSE leaderboard pushes updates to connected clients (ms).
LEADERBOARD_SSE_INTERVAL_MS=2000
# ── Admin ─────────────────────────────────────────────────────
# MUST be changed to a strong secret before any public / production deployment.
ADMIN_TOKEN=changeme-admin
TELEMETRY_ADDR=telemetry-ingester:9003
TELEMETRY_GRPC_ADDR=telemetry-ingester:9003