Skip to content

bug(gateway): repeated OOMs with a stable 3000-sandbox shared-supervisor fleet #6246

Not planned

Description

@TaylorMutch

User Story

I run OpenShell on Kubernetes with shared supervisors and am validating service discovery and application ingress at 3,000 sandboxes / 6,000 services. I need the control-plane gateways to remain available while that fleet is stable and application traffic flows directly through supervisor listeners.

Problem Statement

OpenShell gateway containers repeatedly grow toward their configured 4 GiB memory limits and terminate with OOMKilled / exit 137. Increasing the gateway replica count from two to three did not eliminate the terminations. The allocation source and whether the working set would plateau at a larger budget are not established.

This issue captures the observation for later triage, separately from the routing fixes in #6183. The test images predate the pending main rebase; reproduction against rebuilt rebased images remains required.

Impact / Why This Matters

The control plane repeatedly loses gateway processes with a stable sandbox fleet. The two-replica run also recorded three failed control-plane inventory calls with EOF/deadline errors. Application requests continued through the separate data plane, but that does not qualify gateway availability or memory stability. Additional replicas alone have not resolved the observed growth.

Observed Evidence

Configuration Observation
2 gateways, each limited to 4 GiB Each container restarted six times during 66.45 full-population minutes: counters 0→6 and 1→7.
3 gateways, same images and memory limits Each container restarted twice during the interrupted comparison: counters 0→2, 74→76, and 75→77. Full-population duration was 2,542 seconds (42.37 minutes).

Working-set samples repeatedly climbed from approximately 0.6–1.3 GiB toward 4 GiB and reset after container restart. Pod identities remained unchanged. The original pair continued accumulating restarts after the earlier load stopped; their counters were 74 each at the later preflight, so Locust traffic alone does not explain the observation.

Representative captured container status:

resources.limits.memory: 4Gi
lastState.terminated.reason: OOMKilled
lastState.terminated.exitCode: 137

The three-replica comparison retained 3,000 Ready sandboxes, 3,000 persisted installation records, and all 6,000 routes. Successful observations showed unchanged sandbox identities, ownership and installation versions, with no inventory-monitor errors. It recorded 14,242,874 operations and 596 DNS failures; no non-DNS request failure was recorded. The run was stopped intentionally to finish fixes and rebuild the rebased stack, so it is not a completed qualification.

Reproduction Steps

  1. Deploy the stack through the Helm chart with PostgreSQL, twelve shared supervisors, application listeners and discovery enabled, and two OpenShell gateway replicas. Give each gateway a 4 GiB memory limit and six-core CPU limit (requests were 1 GiB / four cores).
  2. Populate a stable fleet of 3,000 sandboxes exposing two services each. Direct application traffic through the Envoy discovery-consumer example to supervisor application listeners, bypassing the OpenShell gateway data path.
  3. Observe gateway working set, container termination reasons/restart counts, and control-plane availability during a quiet period and a sustained mixed-workload run. Retain the normal 3,600-second JWT lifetime.
  4. Increase only the OpenShell gateway replica count from two to three through Helm and repeat with the same fleet, images, and resource limits.

Environment

  • OpenShell functional changes equivalent to fixes head 420435e2bbdbb0139d2a9af941ce619e4a437654, with four local DEBUG-only instrumentation differences.
  • Gateway image digest: sha256:e61d98ef61be4088e9133a8afd46dd2cb70e4a919c4287d62559f2c41da57c74.
  • GKE, Kubernetes compute driver, shared-supervisor topology, PostgreSQL, Helm deployment.
  • Public Envoy Gateway TLS passthrough → Envoy discovery example → supervisor app listener → sandbox service. OpenShell gateways carry management/discovery traffic.
  • The comparison used 30,000 allocated clients; load workers are now stopped and the fleet remains deployed.

Triage Leads and Limits

Acceptance Criteria

  • Reproduce or explicitly rule out the observation with images rebuilt from the rebased stack and record exact source/image versions.
  • Identify the dominant allocations and distinguish a bounded capacity requirement from retained or leaking memory.
  • Fix the cause or document a measured, bounded resource-sizing requirement with appropriate regressions where a defect is found.
  • Repeat the stable 3,000-sandbox comparison for at least a full normal credential-renewal cycle plus a quiet observation period, without gateway OOMs at the documented resource budget.
  • Report control-plane availability separately from application data-plane continuity.

Activity

  1. added
    state:accepted
    on Dec 4, 2026
  2. added theissue type on Dec 4, 2026
  3. TaylorMutch commented on Dec 4, 2026

    @TaylorMutch
    ContributorAuthor

    Related logging redesign: #5948. This OOM investigation remains separate: the dominant allocations and any connection to log retention or ingestion are unproven. Reproduce on rebuilt images and distinguish live heap, allocator retention, and other container memory; the redesign does not establish or resolve the cause.

  4. added
    area:platform
    topic:performance
    topic:reliability
    on Dec 4, 2026
  5. TaylorMutch commented on Dec 5, 2026

    @TaylorMutch
    ContributorAuthor

    Closing in favor of #5948 (Move Sandbox Logging to the Supervisor / Data Plane). Gateway-side per-sandbox log and event buffering is the memory/scalability issue to address through that refactor, rather than carrying a separate fix under this issue.

    The 3,000-sandbox OOM observations and reproduction details above remain the validation case for that work. Repeat the qualification after the logging refactor to confirm gateway memory stability and control-plane availability at the recorded resource budget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:platformstate:acceptedtopic:performancetopic:reliability

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions