Skip to content

Deploy Lifecycle And Long-Lived Connections

BeamUp deploys are connection-aware, but SLC v1 does not provide transparent TCP, WebSocket, or SSE state migration. Clients must handle reconnects.

  1. beamup deploy creates an immutable deployment.
  2. BeamUp builds the source and stores the artifact.
  3. The worker starts a candidate runtime.
  4. The runtime receives platform-owned PORT, PATH, and configured env/secret values as strings.
  5. BeamUp checks PORT binding and the configured health path.
  6. Only a healthy candidate can become active.
  7. The app active pointer moves to the candidate in one committed update.
  8. The previous active deployment becomes superseded and its runtime enters the drain/cleanup path.

Unhealthy deployments never replace a healthy active deployment.

Private SLC production runs one steady-state runtime instance per app. During a healthy replacement, a second runtime may exist temporarily for activation and drain.

After a successful route switch:

  1. BeamUp deregisters the previous target from new traffic.
  2. The connection-drain window runs for 30 seconds.
  3. After the drain point, BeamUp sends SIGTERM to the Erlang runtime.
  4. Supported OTP receives this as a normal shutdown opportunity.
  5. BeamUp waits a bounded 10-second OTP shutdown grace.
  6. BeamUp force terminates only if the runtime has not exited after that grace period.

Status and cockpit surfaces may show runtime states such as draining, stopping, and stopped, plus shutdown outcomes:

  • graceful: the runtime exited during the OTP shutdown grace.
  • forced: BeamUp terminated it after the grace period.
  • failed: cleanup did not complete and retry is pending.

Unexpected instance or VM failure remains possible. Do not use runtime instance memory, actor state, ETS state, or local files as durable storage.

The AWS-verified private SLC ingress settings are:

  • ALB idle timeout: 60 seconds.
  • HTTP client keepalive: 3,600 seconds.
  • Target deregistration delay: 30 seconds.

Use application-level WebSocket/SSE heartbeat intervals shorter than the 60-second idle timeout. The verified private SLC fixture used SSE heartbeats every 2 seconds. That connection stayed active during healthy redeploy and the 30-second drain window, and reconnect after drain reached the new active deployment.

Manual rollback routing was also verified with an existing SSE connection during drain and a reconnect after the switch.

BeamUp SLC v1 does not promise:

  • Transparent connection migration.
  • No reconnects.
  • TCP handoff.
  • Hot code upgrades.
  • :sys.change_code-style deploys.
  • Preserving in-memory BEAM state across redeploy or unplanned failure.
  • A specific WebSocket/SSE connection capacity.
  • Unmetered connection pricing.

Long-lived clients should reconnect with normal backoff and tolerate a route switch.