Skip to content

Raise the bootstrappers' inbound connection limit to 64000 - #7

Merged
nymd merged 1 commit into
mainfrom
raise-bootstrap-inbound-conn-limit
Oct 16, 2026
Merged

nymd merged 1 commit into
mainfrom
raise-bootstrap-inbound-conn-limit

Conversation

@nymd

@nymd nymd commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Problem

All four bootstrap instances (sg1, am6, ny5, sv15) had used their 16000 inbound connection slots (kubo System.ConnsInbound). The resource manager then refused new connections while the ports still accepted TCP, so fresh handshakes from outside succeeded about 1 time in 5. ProbeLab saw this as flapping, with each peer alternating OK and FAIL.

How it showed up: TCP connect succeeded, then the security handshake ended in EOF, and QUIC got CONNECTION_REFUSED. Pods, listeners, ufw, CPU, memory and file descriptors were all fine, and the pods had 0 restarts. ipfs swarm resources showed system ConnsInbound 16000 / 16000 (100%) on all four instances. It took about 15 days to fill. The holders were spread across thousands of peers, with no single heavy client.

Change

roles/bootstrap/files/kubo-config.json:

Setting Before After
Swarm.ConnMgr.HighWater 8000 32000
Swarm.ConnMgr.LowWater 4000 16000
Swarm.ResourceMgr.MaxFileDescriptors 65536 131072

Kubo computes System.ConnsInbound as 2 x HighWater, so the limit goes from 16000 to 64000. The old config used about 15000 file descriptors at 16000 connections, so roughly 60000 at the new limit, which fits the new 131072.

Swarm.ResourceMgr.Limits is not an option. Kubo removed it in 0.19 and the init container refuses a config that sets it. An earlier rollout of mine tried it and took sing-1 (sg1) down for about 15 minutes before it was restored.

Rollout and verification

Already applied by hand with ansible-playbook bootstrap.yml -l <box> -t bootstrap, one box at a time (sing-1, lith-1, chic-1), each failed=0. After the rollout:

  • All four instances show system ConnsInbound 64000 (3-5% used) and FD 131072.
  • Each bootstrapper completed 5 of 5 fresh handshakes from outside, from a throwaway kubo v0.43.1 node whose only bootstrap peers were the four /dnsaddr/*.bootstrap.libp2p.io entries.

Follow up

  • Re-check ipfs swarm resources in about a week to see whether usage plateaus well under 64000.
  • The cause of the original saturation is not found: the old HighWater of 8000 did not keep connections down to that mark.
  • bootstrap.yml --check fails on a check-mode-only conditional at roles/bootstrap/tasks/instance.yml:222 (string used as a boolean). It is unrelated to this change.

🤖 Generated with Claude Code

All four bootstrap instances had used their 16000 inbound connection slots
(System.ConnsInbound), so kubo's resource manager refused new connections
while the ports still accepted TCP. Fresh handshakes from outside succeeded
about 1 time in 5, which the ProbeLab probes saw as flapping.

Kubo computes System.ConnsInbound as 2 x ConnMgr.HighWater, so raise
HighWater to 32000 and LowWater to 16000, giving 64000. Raise
MaxFileDescriptors to 131072 for the roughly 60000 descriptors that many
connections need.

Swarm.ResourceMgr.Limits is not an option: kubo removed it in 0.19 and
refuses to start with it set.

Rolled out one box at a time on 2026-10-16. All four instances show a
64000 limit and complete 5 of 5 handshakes from outside.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nymd
nymd merged commit 3f5d408 into main Oct 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant