feat: add docker capacity benchmark mode

This commit is contained in:
Codex
2026-07-01 03:31:17 +08:00
parent eb3dca5fb8
commit 3d33c783cd
11 changed files with 242 additions and 6 deletions

View File

@@ -557,6 +557,15 @@ docs/refactor/postgresql-4c16g-tuning.md
docs/refactor/performance-benchmark-runbook.md
```
本地 Docker Desktop 可用时,可以先用受限 API 容器做 4 核 16G shared-host 风格的预演。该入口默认把 API 容器限制为 2 CPU/4G、关闭 legacy `x-user-id`,并用 `Authorization: Bearer <tk_session>` 跑 30 只读、50/100 混合读写矩阵:
```powershell
$env:DATABASE_URL="postgresql://postgres:postgres@127.0.0.1:54322/postgres"
npm run perf:api:docker-4c16g
```
注意:这个入口只限制 API 容器资源,本地 Supabase/PostgreSQL 仍受 Docker Desktop 全局资源影响。正式容量承诺仍要在目标 4 核 16G 云服务器复跑。
PostgreSQL 调参与运行证据采集:
```powershell