feat(servers): per-server memory ceiling, because 512Mi OOMKills silently #132
Reference in New Issue
Block a user
Delete Branch "feat/server-memory-limit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
MCP server pods have a hardcoded 512Mi limit. Fine for an API proxy, fatal for a server that drives a browser:
docs(docs-mcp-server, scrapes with headless Chromium) idles at ~228Mi and crosses 512Mi seconds into its first scrape.Why this was invisible. An OOMKill reports nothing: kernel kills it, pod restarts, readiness passes, instance reads
healthy. Six scrape jobs (queue held in memory) vanished and the index kept 17 pages.mcpctl logsshows nothing, because the process never got to speak.Change:
memoryLimitMbon the server (MiB), converted to bytes in the ContainerSpec. NULL keepsDEFAULT_MEMORY_LIMIT, so existing servers are unchanged — raising the fleet default would waste memory on every node for servers that do not need it.Threaded through the places a new column dies quietly: Prisma migration, create/update validation, the repository field-by-field mapping, apply.ts server spec, the CLI flag, and shell completions.
Tests: repository mapping (create + update + absent), and instance.service converting MiB to bytes / leaving the spec untouched when unset. mcpd 1159 passed, cli 740 passed, tsc clean.
Docs: docs/reliability.md gains "A server that restarts instead of erroring is out of memory" — the
lastState.terminated.reasoncheck that turns "it restarted again" into an answer.🤖 Generated with Claude Code
https://claude.ai/code/session_01JPjtnE6Gd343oRNtMU9Bcd