CloudAgentNext - Enable tool cgroup resource limits for all orgs#4476
Merged
Conversation
Permanently enable the sandbox tool/server cgroup partition in production by setting the per-org gate to all orgs (TOOL_CGROUP_ORG_IDS=*), enforce mode (memory.max applied), 1GB reserved memory, and tool cpu.weight 50 (server slice keeps the kernel default of 100 for 2x priority).
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the 4-line Files Reviewed (1 files)
Reviewed by claude-sonnet-5-20260630 · Input: 14 · Output: 4K · Cached: 354.2K Review guidance: REVIEW.md from base branch |
jeanduplessis
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Permanently enable the sandbox tool/server cgroup partition in production (was disabled for every org by default).
Changes
Adds production
varstoservices/cloud-agent-next/wrangler.jsonc:TOOL_CGROUP_ORG_IDS=*— opens the per-org gate to all orgs (was unset → off for everyone)TOOL_CGROUP_MODE=enforce— appliesmemory.maxto the tool slice (was defaulting tooff)TOOL_CGROUP_RESERVE_MB=1024— 1GB reserved back from the tool cap (default was 1536)TOOL_CGROUP_CPU_WEIGHT=50— tool slicecpu.weight; the kilo-server slice keeps the kernel default (100), giving the server 2x the CPU share of tools under contentionEffect
Tool cap =
MemTotal − 1GB. Smallest sandbox (4GB) yields a 3GB cap, clearing the 1GB minimum-cap floor on every container class, soenforceapplies everywhere. A runaway tool is now OOM-killed in seconds instead of thrashing the whole container.Dev (
env.dev) stays disabled (TOOL_CGROUP_ORG_IDS=""); macOS local dev can't do cgroups.Verification
wrangler.jsoncparses; production values confirmed, dev unchanged.queue-config.test.ts,devcontainer.test.ts.cloudflare-agent-sandbox.test.ts,wrapper-client.test.ts.