Skip to content

bench(ci): add C1M HTTPS gate script and nightly workflow (#413) - #423

Merged
gg582 merged 1 commit into
c4punks:devfrom
Bhumika-1432006:bench/c1m-ci
Oct 20, 2026
Merged

gg582 merged 1 commit into
c4punks:devfrom
Bhumika-1432006:bench/c1m-ci

Conversation

@Bhumika-1432006

Copy link
Copy Markdown
Contributor

Closes #413.

The C100K gate runs on every PR push and catches per-PR connection-cost
regressions. This PR adds the C1M gate for nightly regression detection
at one million concurrent connections.

scripts/ci/c1m_https.sh

Same structure as c100k_https.sh, scaled to 1M connections:

  • Creates a dedicated Linux network namespace (CWIST_C1M_NETNS) and
    adds 50 loopback addresses in 127.1.0.0/16 (127.1.0.1 through
    127.1.49.1). Each address holds ~55K ephemeral ports (range
    widened to 1024–65535 inside the namespace), giving 2.75M total
    ports for 1M connections.
  • Cleans up the namespace and addresses on exit.
  • Passes the same gate criteria as C100K: all connections established,
    none dropped, all requests answered with 200, ramp within
    C1M_RAMP_MAX_S (default 600 s), RSS+swap ≤ 8192 B/conn.
  • Writes $GITHUB_STEP_SUMMARY in the same format as the C100K script.
  • All limits are overridable via env vars (C1M_CONNS,
    C1M_RAMP_MAX_S, C1M_RSS_PER_CONN_MAX_BYTES, etc.).

.github/workflows/c1m.yml

  • Runs on [self-hosted, c1m] runners: C1M needs ~16 GiB RAM and
    CAP_NET_ADMIN for ip netns, which GitHub-hosted runners do not
    provide.
  • Cadence: nightly at 02:30 UTC (after the C100K nightly at 01:30);
    also workflow_dispatch with optional conns and ramp_max_s
    overrides for release validation.
  • Matrix: c1m mode and full-gc mode, fail-fast: false.
  • Raises RLIMIT_NOFILE to 1 050 000 via prlimit before the script.
  • Does not trigger on PR/push: per-PR regressions are caught by
    c100k.yml.

How it was verified: the script logic mirrors c100k_https.sh exactly
for all shared gate/reporting paths; only the address setup and
defaults differ. The netns cleanup path was traced through all three
exit routes (EXIT trap, setup failure, gate failure).

🤖 Generated with Claude Code

The C100K gate already runs on every PR push. This PR wires the C1M
gate into CI for nightly regression detection.

scripts/ci/c1m_https.sh:

The script follows the same structure as c100k_https.sh but for one
million connections. Key differences:

- 50 loopback addresses in 127.1.0.0/16 (127.1.0.1 .. 127.1.49.1)
  created inside a dedicated network namespace; each holds ~55K
  ephemeral ports, giving 2.75M ports for 1M connections.
- Network namespace setup: creates CWIST_C1M_NETNS (or runs in an
  existing one), adds the 50 addresses to lo, widens the ephemeral
  port range to 1024-65535 inside the namespace, and cleans up on exit.
- Default ramp limit raised to 600 s (vs 180 s for C100K).
- CWIST_WORKERS defaults to 8, CLIENT_THREADS to 12.
- Gate criteria are the same: all connections established, none
  dropped, all requests answered with 200, ramp within the limit,
  RSS+swap <= 8192 B/conn.

.github/workflows/c1m.yml:

- Runs on self-hosted runners tagged [self-hosted, c1m]; the C1M run
  needs ~16 GiB RAM and CAP_NET_ADMIN for ip-netns, which
  GitHub-hosted runners do not provide.
- Cadence: nightly at 02:30 UTC (after the C100K nightly); also
  workflow_dispatch with optional conns and ramp_max_s overrides.
- Matrix: c1m mode and full-gc mode, fail-fast disabled.
- Raises RLIMIT_NOFILE to 1 050 000 via prlimit before the script.
- Does not run on PR/push: per-PR regressions are caught by c100k.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gg582
gg582 merged commit 338b1aa into c4punks:dev Oct 20, 2026
26 checks passed
gg582 pushed a commit that referenced this pull request Oct 20, 2026
The C100K gate already runs on every PR push. This PR wires the C1M
gate into CI for nightly regression detection.

scripts/ci/c1m_https.sh:

The script follows the same structure as c100k_https.sh but for one
million connections. Key differences:

- 50 loopback addresses in 127.1.0.0/16 (127.1.0.1 .. 127.1.49.1)
  created inside a dedicated network namespace; each holds ~55K
  ephemeral ports, giving 2.75M ports for 1M connections.
- Network namespace setup: creates CWIST_C1M_NETNS (or runs in an
  existing one), adds the 50 addresses to lo, widens the ephemeral
  port range to 1024-65535 inside the namespace, and cleans up on exit.
- Default ramp limit raised to 600 s (vs 180 s for C100K).
- CWIST_WORKERS defaults to 8, CLIENT_THREADS to 12.
- Gate criteria are the same: all connections established, none
  dropped, all requests answered with 200, ramp within the limit,
  RSS+swap <= 8192 B/conn.

.github/workflows/c1m.yml:

- Runs on self-hosted runners tagged [self-hosted, c1m]; the C1M run
  needs ~16 GiB RAM and CAP_NET_ADMIN for ip-netns, which
  GitHub-hosted runners do not provide.
- Cadence: nightly at 02:30 UTC (after the C100K nightly); also
  workflow_dispatch with optional conns and ramp_max_s overrides.
- Matrix: c1m mode and full-gc mode, fail-fast disabled.
- Raises RLIMIT_NOFILE to 1 050 000 via prlimit before the script.
- Does not run on PR/push: per-PR regressions are caught by c100k.yml.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants