Document limits, load control and performance

- New docs/09-limits-and-performance.md: principles, all protection
  layers, what players see, configuration reference, measurements,
  tuning guide, monitoring and how to test
- Server chapter summarises the limits and links to chapter 9; circuit
  breaker description and AI_MAX_INFLIGHT default corrected
- Architecture: new files in the layout, design decisions for load
  handling; docs index lists chapter 9
- Protocol, AI and operations chapters link to chapter 9; test counts
- Root and component READMEs describe the limits and settings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 13:04:21 +02:00
co-authored by Claude Opus 5.5
parent 763c5678f1
commit 9ffee8b952
11 changed files with 462 additions and 111 deletions
+16 -1
View File
@@ -33,10 +33,25 @@ The `Observation` / action JSON format is defined once in `wizard_game` and shar
frontend, the server and the AI, so AI models see exactly the same data in training and in
production.
## Limits and load control
Wizard shares its host with other services, so its resource use is bounded in layers
(details: [`docs/09-limits-and-performance.md`](docs/09-limits-and-performance.md)):
- **Docker caps** per container (server 1 CPU / 512 MB, AI 1 CPU / 1 GB, website 0.25 CPU / 64 MB),
set in `.env`.
- **Abuse limits**: connections per IP and in total, messages per second per connection,
lobbies per IP per minute.
- **Overload handling**: the server watches event loop lag, CPU and cgroup throttling. While it
is overloaded, or `MAX_ACTIVE_GAMES` games are running, new lobbies and game starts are refused
("server busy" in the UI). Running games always continue.
- **AI cost bounds**: bounded queue and workers in the AI service, which falls back to the cheap
heuristic player when busy; circuit breaker and in-flight cap in the server.
## Deployment
```bash
cp .env.example .env # set AI_SHARED_SECRET
cp .env.example .env # set AI_SHARED_SECRET (limits optional)
docker network create wizard_website # if they don't exist yet
docker network create wizard_api
docker compose up -d --build