Repository navigation
Description
Summary
spore.host's shared infrastructure should scale to support many concurrent activities — multiple users, parallel sweeps, fleets of instances launching at once, and the e2e test suite — better than it does today. Surfaced concretely when ~22 concurrent launches in the Tier 2 run overwhelmed the client/launch path (#56), but the concern is broader than tests.
What we know (grounded)
- DynamoDB: already
PAY_PER_REQUEST(on-demand) across the CFN templates — scales automatically, not the bottleneck. ✓ - Client-side serialization is the immediate pain: DNS registration SSHes into each instance (
registerDNS,launch.go:2498) which then curls the DNS API. 22 parallelspawnprocesses share one SSH ControlMaster socket (~/.ssh/cm-*), which serialized everything (e2e Tier 2 harness can't run ~22 launches in parallel — waitForRunning times out, SSH ControlMaster contention #56). This is a per-client scaling limit but it's the one that bit us. - Lambda backends (dns-updater, dashboard-api, alert/scheduler/autoscale/pipeline orchestrators, cost-history, websocket) have no reserved/declared concurrency in their templates — under a burst (e.g. a 100-instance sweep all registering DNS at once) they're subject to the account's shared Lambda concurrency limit and could throttle.
- Route53 has per-hosted-zone API rate limits (5 req/s) — a burst of DNS UPSERTs could throttle; is there batching/backoff?
Axes to evaluate
- Launch throughput — can N instances launch concurrently without client-side or API throttling? Decouple DNS registration from the synchronous launch path (e.g. instance self-registers via spored on boot, not via the client SSHing in).
- DNS API — Lambda concurrency + Route53 rate limits + retry/backoff; batch UPSERTs where possible.
- Per-client concurrency — the SSH ControlMaster / DNS-registration contention (e2e Tier 2 harness can't run ~22 launches in parallel — waitForRunning times out, SSH ControlMaster contention #56) is partly a client design issue: per-instance ControlPath, or skip client-side SSH for registration entirely.
- Multi-user isolation — tables are per-user-tagged already; confirm no shared hot keys / cross-user contention as user count grows.
- Observability — can we see throttling when it happens (CloudWatch on Lambda throttles, DDB, Route53)?
Deliverable
A scaling assessment + prioritized plan: identify the real ceilings (launch fan-out, DNS API, Lambda concurrency), recommend fixes (likely: move DNS registration off the synchronous client SSH path → instance self-registers via spored; add Lambda reserved concurrency / Route53 backoff). Not all at once — rank by impact.
Context
Raised alongside the Tier 2 work. #56 is the test-harness symptom; this issue is the underlying infra capacity. The DNS-registration-via-client-SSH design (3 above) is the most likely first win and also fixes #56's root cause.
Activity
fix(e2e): unblock Tier 2 parallel runs (#56) (#60)