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>
117 lines
3.1 KiB
YAML
117 lines
3.1 KiB
YAML
services:
|
|
orchestrator:
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "1"
|
|
memory: 512M
|
|
build: services/orchestrator
|
|
ports:
|
|
- "${ORCHESTRATOR_BIND:-0.0.0.0}:${ORCHESTRATOR_PORT:-8000}:8000"
|
|
environment:
|
|
RENDERER_URL: http://renderer:8002
|
|
EXTRACTOR_URL: http://extractor:8003
|
|
SEARCHER_URL: http://searcher:8001
|
|
REDIS_URL: redis://redis:6379
|
|
EXTRACT_CACHE_TTL: ${EXTRACT_CACHE_TTL:-3600}
|
|
STAGE_TIMEOUT_S: ${STAGE_TIMEOUT_S:-60}
|
|
LWSS_API_KEY: ${LWSS_API_KEY:-}
|
|
MCP_ALLOWED_HOSTS: ${MCP_ALLOWED_HOSTS:-}
|
|
depends_on:
|
|
- searcher
|
|
- renderer
|
|
- extractor
|
|
- redis
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
searcher:
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.5"
|
|
memory: 256M
|
|
build: services/searcher
|
|
environment:
|
|
REDIS_URL: redis://redis:6379
|
|
SEARCH_CACHE_TTL: ${SEARCH_CACHE_TTL:-300}
|
|
SEARCH_TIMEOUT_S: ${SEARCH_TIMEOUT_S:-15}
|
|
INSTANCES_FILE: /config/instances.yml
|
|
volumes:
|
|
- ./config:/config:ro
|
|
depends_on:
|
|
- searxng
|
|
- redis
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/health')"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
searxng:
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "1"
|
|
memory: 512M
|
|
image: searxng/searxng:latest
|
|
environment:
|
|
SEARXNG_SECRET: ${SEARXNG_SECRET:-change-me-lwss-internal}
|
|
SEARXNG_BASE_URL: http://searxng:8080/
|
|
volumes:
|
|
- ./searxng:/etc/searxng:ro
|
|
|
|
renderer:
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
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:-8}
|
|
RENDER_TIMEOUT_MS: ${RENDER_TIMEOUT_MS:-30000}
|
|
RENDER_WAIT_POLICY: ${RENDER_WAIT_POLICY:-networkidle}
|
|
RENDER_RETRIES: ${RENDER_RETRIES:-1}
|
|
DOMAIN_RATE_LIMIT: ${DOMAIN_RATE_LIMIT:-10}
|
|
DOMAIN_RATE_WINDOW_S: ${DOMAIN_RATE_WINDOW_S:-10}
|
|
depends_on:
|
|
- redis
|
|
init: true
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:8002/health').then(r=>{if(!r.ok)process.exit(1)})"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
extractor:
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "1"
|
|
memory: 512M
|
|
build: services/extractor
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8003/health')"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
redis:
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.5"
|
|
memory: 640M
|
|
image: redis:7-alpine
|
|
command: redis-server --maxmemory 512mb --maxmemory-policy allkeys-lru
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|