Skip to content

setup-gcp: raise node ARP table and inotify sysctls for high sandbox density - #2444

Merged
Benjamin Elder (BenTheElder) merged 4 commits into
agent-substrate:mainfrom
chw120:fix/raise-node-arp-inotify-sysctls
Oct 16, 2026
Merged

Benjamin Elder (BenTheElder) merged 4 commits into
agent-substrate:mainfrom
chw120:fix/raise-node-arp-inotify-sysctls

Conversation

@chw120

Copy link
Copy Markdown
Collaborator

Summary

Each awake actor sandbox creates its own network namespace, veth/tap pair, and inotify watches on the host kernel (even in multi-actor worker pods). At the default COS kernel limits (net.ipv4.neigh.default.gc_thresh3 = 1024, fs.inotify.max_user_instances = 128, fs.inotify.max_user_watches = 8192–65536), nodes hit inotify exhaustion around ~800 live sandboxes and ARP table overflow (neighbour: arp_cache: neighbor table overflow!) around ~1,000 live sandboxes per node, causing new sandbox creation/networking to fail (100% ping failure at 1,000 sandboxes/node; 0% failure up to 1,500 sandboxes/node once raised).

This PR:

  1. Configures LinuxNodeConfig.Sysctls on the default substrate-node-pool created by tools/setup-gcp/cmd/cluster.go:
    • net.ipv4.neigh.default.gc_thresh1 = 4096
    • net.ipv4.neigh.default.gc_thresh2 = 8192
    • net.ipv4.neigh.default.gc_thresh3 = 16384
    • fs.inotify.max_user_instances = 65536
    • fs.inotify.max_user_watches = 1048576
      (Note: GKE creates an IPv4-only VPC cluster by default and rejects net.ipv6.neigh.default.gc_thresh* in LinuxNodeConfig.Sysctls.)
  2. Adds unit test assertions in tools/setup-gcp/cmd/cluster_test.go verifying the node pool's LinuxNodeConfig.Sysctls.
  3. Documents in tools/setup-gcp/README.md:
    • How to pass --system-config-from-file=systemconfig.yaml when creating additional node pools (e.g., bare-metal pools via gcloud container node-pools create).
    • How to apply an in-place substrate-sysctl-tuner DaemonSet on an already-running node pool without rolling/recreating nodes.

Testing

  • go test ./tools/setup-gcp/cmd/... ./cmd/ate-setup/...

Comment thread tools/setup-gcp/cmd/cluster_test.go Resolved
@ajaysundark

Copy link
Copy Markdown
Contributor
Note: GKE creates an IPv4-only VPC cluster by default and rejects net.ipv6.neigh.default.gc_thresh* in LinuxNodeConfig.Sysctls.)

is IPv6 relevant for Substrate?

Comment thread tools/setup-gcp/README.md Resolved
@ajaysundark

Copy link
Copy Markdown
Contributor

/lgtm

Comment thread tools/setup-gcp/cmd/cluster.go Resolved
Comment thread tools/setup-gcp/README.md Resolved
Comment thread tools/setup-gcp/README.md Resolved
Comment thread tools/setup-gcp/README.md Resolved
@chw120
Chenyi Wang (chw120) force-pushed the fix/raise-node-arp-inotify-sysctls branch from 3a75974 to e376e54 Compare October 14, 2026 00:02
@chw120

Copy link
Copy Markdown
Collaborator Author
Note: GKE creates an IPv4-only VPC cluster by default and rejects net.ipv6.neigh.default.gc_thresh* in LinuxNodeConfig.Sysctls.)

is IPv6 relevant for Substrate?

In Substrate, per-sandbox networking is IPv4-only today. Also looks GKE rejects net.ipv6.neigh.default.gc_thresh*. cc: ajaysundar.k (@ajaysundark)

@chw120
Chenyi Wang (chw120) force-pushed the fix/raise-node-arp-inotify-sysctls branch from e376e54 to 5f36098 Compare October 14, 2026 00:08

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta point: we should really update substrate-gke, and setup-gcp needs to go ...

Comment thread tools/setup-gcp/cmd/cluster.go Resolved
Comment thread tools/setup-gcp/cmd/cluster.go Resolved
Comment thread tools/setup-gcp/README.md Resolved
@chw120

Copy link
Copy Markdown
Collaborator Author

meta point: we should really update substrate-gke, and setup-gcp needs to go ...

I see. Once merged, I will update substrate-gke with the same changes.

@BenTheElder
Benjamin Elder (BenTheElder) added this pull request to the merge queue Oct 16, 2026
Merged via the queue into agent-substrate:main with commit 9b3626c Oct 16, 2026
15 checks passed
@chw120
Chenyi Wang (chw120) deleted the fix/raise-node-arp-inotify-sysctls branch October 16, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants