Raise renderer throughput: default concurrency 4->8, env-tunable CPU/RAM

Load testing the live deploy showed full-quality content-search caps at ~6
concurrent with 4 render slots; renders past the 60s stage timeout silently
drop pages (graceful degradation, not errors). Double the render slots and
size RAM/CPU to match.

- RENDER_CONCURRENCY default 4 -> 8 (the shared, stack-wide render cap)
- renderer deploy limits now env-driven: RENDERER_CPUS (default 4),
  RENDERER_MEMORY (default 4G), was hardcoded 2 CPU / 2G
- .env.example documents the concurrency<->RAM scaling rule (~350-450 MB per
  concurrent render + ~300 MB base) so raising slots doesn't OOM

Host must have the RAM/CPU; tune down on light VPSs (concurrency 4 -> 2G/2CPU).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
User 2026-07-06 12:11:18 -07:00
parent 382cc97e98
commit ae56657d94
2 changed files with 14 additions and 4 deletions

View file

@ -68,13 +68,13 @@ services:
deploy:
resources:
limits:
cpus: "2"
memory: 2G
cpus: "${RENDERER_CPUS:-4}"
memory: ${RENDERER_MEMORY:-4G}
build: services/renderer
environment:
REDIS_URL: redis://redis:6379
RENDER_CACHE_TTL: ${RENDER_CACHE_TTL:-3600}
RENDER_CONCURRENCY: ${RENDER_CONCURRENCY:-4}
RENDER_CONCURRENCY: ${RENDER_CONCURRENCY:-8}
RENDER_TIMEOUT_MS: ${RENDER_TIMEOUT_MS:-30000}
RENDER_WAIT_POLICY: ${RENDER_WAIT_POLICY:-networkidle}
RENDER_RETRIES: ${RENDER_RETRIES:-1}