You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Error Handling**: Complete HTTP status code mapping
421
421
422
422
### Current Resource Isolation Specifications
423
-
-**Physical Memory Limit**: 512MB RAM per MCP server process via cgroup (precise enforcement)
424
-
-**Virtual Memory Limit**: 2048MB RAM via rlimit (fallback for non-cgroup systems)
423
+
-**Virtual Memory Limit**: unlimited (rlimit_as=inf) — Node.js v24 WASM (undici HTTP parser) reserves ~10GB virtual address space; this is virtual, not physical RAM
424
+
-**Physical Memory Limit**: 512MB per MCP server process via cgroup — active only when satellite runs as a systemd service with `Delegate=yes`; falls back to rlimit-only otherwise
425
425
-**CPU Limit**: 60s CPU time limit
426
426
-**Process Limit**: 1000 processes per MCP server (accommodates package managers like npm, uvx)
427
427
-**Process Timeout**: 3-minute idle timeout for automatic cleanup
428
-
-**Isolation Method**: nsjail with Linux namespaces (PID, mount, UTS, IPC) and cgroup enforcement
428
+
-**Isolation Method**: nsjail with Linux namespaces (PID, mount, UTS, IPC); cgroup v2 auto-detected at startup
429
429
-**Runtime-Aware Caching**: Separate cache directories per runtime (`/mcp-cache/node/{team_id}`, `/mcp-cache/python/{team_id}`)
- tmpfs for GitHub deployments (/app): 300MB kernel-enforced quota
582
+
- Physical memory: 512MB per process via cgroup — auto-detected at startup; active only when satellite runs as a systemd service with `Delegate=yes` (see [Enable Cgroup Limits](/self-hosted/production-satellite#enable-cgroup-limits))
Copy file name to clipboardExpand all lines: self-hosted/production-satellite.mdx
+30-24Lines changed: 30 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ For **development or single-team** usage, the [Docker Compose setup](/self-hoste
21
21
Production satellites provide enterprise-grade security through:
22
22
23
23
-**nsjail Process Isolation**: Complete process separation per team with Linux namespaces and cgroup enforcement
24
-
-**Resource Limits**: CPU, memory, and process limits per MCP server (512MB physical RAM via cgroup, 2GB virtual RAM via rlimit, 60s CPU, 1000 processes)
24
+
-**Resource Limits**: CPU, memory, and process limits per MCP server (virtual RAM unlimited via rlimit, 512MB physical RAM via cgroup when enabled, 60s CPU, 1000 processes)
25
25
-**Multi-Runtime Support**: Node.js (npx) and Python (uvx) with runtime-aware isolation
26
26
-**Filesystem Jailing**: Read-only system directories, isolated writable spaces per runtime
27
27
-**Non-Root Execution**: Satellite runs as dedicated `deploystack` user
NSJAIL_CGROUP_MEM_MAX_BYTES=536870912 # Physical memory limit: 512MB (cgroup, only active with Delegate=yes in systemd unit)
332
332
NSJAIL_CPU_TIME_LIMIT_SECONDS=60 # CPU time limit
333
333
NSJAIL_MAX_PROCESSES=1000 # Process limit (rlimit)
334
334
NSJAIL_CGROUP_PIDS_MAX=1000 # Process limit (cgroup)
@@ -543,16 +543,17 @@ Production satellites use nsjail to provide:
543
543
544
544
Each MCP server process is limited to:
545
545
546
-
-**Virtual Memory**: 2048MB (enforced via rlimit_as)
546
+
-**Virtual Memory**: unlimited (rlimit_as = `inf` — required because Node.js v24 uses WASM internally which reserves ~10GB of virtual address space; this is virtual, not physical RAM)
547
+
-**Physical Memory**: 512MB via cgroup (only active when `Delegate=yes` is set in the systemd unit — see below)
547
548
-**CPU Time**: 60 seconds (enforced via rlimit_cpu)
548
-
-**Processes**: 1000 (enforced via rlimit_nproc, required for package managers like npm and uvx)
549
+
-**Processes**: 1000 (enforced via rlimit_nproc and cgroup pids.max, required for package managers like npm and uvx)
549
550
-**File Descriptors**: 1024 (enforced via rlimit_nofile)
550
551
-**Maximum File Size**: 50MB (enforced via rlimit_fsize)
551
552
-**tmpfs /tmp**: 100MB (enforced via tmpfs mount)
552
553
553
-
<Warning>
554
-
**Cgroup Limits Currently Disabled**: Physical memory (512MB) and process count cgroup limits are disabled due to systemd cgroup delegation permissions. The satellite uses rlimit-based resource controls instead, which provide equivalent DoS protection. See the Future Enhancement section below for re-enabling cgroup limits via systemd delegation.
555
-
</Warning>
554
+
<Info>
555
+
**Cgroup limits are auto-detected**: The satellite automatically detects whether cgroup v2 is available and delegated. When running as a systemd service with `Delegate=yes`, physical memory (512MB) and PID limits are enforced via cgroup in addition to rlimits. Without `Delegate=yes`, the satellite falls back to rlimit-only mode — nsjail still runs safely with full namespace isolation. See the [Enable Cgroup Limits](#enable-cgroup-limits)section below to activate precise physical memory enforcement.
556
+
</Info>
556
557
557
558
<Info>
558
559
**Primary Security = Namespace Isolation**: The satellite's security model relies on Linux namespaces (PID, Mount, User, IPC, UTS) to isolate MCP servers from each other and the host system. Resource limits (rlimits) provide secondary DoS protection. With user namespace active, all privilege escalation attacks (including setuid-based rlimit bypasses) are prevented.
@@ -771,9 +772,9 @@ Monitor and plan for:
771
772
- Log disk usage growth
772
773
- Network bandwidth for backend communication
773
774
774
-
## Future Enhancement: Enable Cgroup Limits
775
+
## Enable Cgroup Limits
775
776
776
-
Currently, cgroup limits are disabled due to systemd cgroup delegation permissions. To re-enable precise physical memory (512MB) and process count limits in the future:
777
+
By default the satellite runs in rlimit-only mode. Adding `Delegate=yes`to the systemd unit gives the satellite ownership of its cgroup subtree, which activates precise physical memory (512MB) and PID enforcement per MCP process. **No code changes are needed** — the satellite auto-detects cgroup availability at startup.
**Note**: This enhancement is optional. The current rlimit-based approach provides strong security through namespace isolation and adequate DoS protection. Cgroup limits add precision to resource accounting but don't change the fundamental security model.
830
+
**Cgroup limits are optional.** The rlimit-only default provides strong security through namespace isolation and adequate DoS protection. Cgroup limits add precise physical memory enforcement per MCP process, which is useful in high-density multi-team environments where a single runaway process consuming all RAM would otherwise affect other teams.
0 commit comments