Skip to the page

Guides · Shipping & operations

Launch preparation

Load-test a copy of main, plan for the project limits, raise the spend cap, scale the cluster and hold maintenance for launch week.

In the schema
—

What you’ll build#

This page prepares a project for launch-day traffic. You load-test the busiest screens on a full-data preview branch, budget for per-project capacity limits, raise the monthly spend cap, scale engines and read replicas a few days ahead and place a maintenance hold on the cluster for launch week.

Scale & recovery explains each layer of a cluster, while this guide walks through the exact commands and sequence ahead of launch.

Locked-down production endpoint

Enter launch week with --passthrough keys, --hide-schema and exact --allow-origin hosts on main while load-testing heavy screens on a --preview --data branch.

Continuous archive & maintenance hold

napalm clusters hold defers routine cluster maintenance during launch week while continuous archiving and napalm clusters backup preserve point-in-time recovery.

Spend ceiling & query insights

Raise napalm orgs limits --cap and --alert ahead of napalm clusters scale, then monitor slow statements and live subscription headroom via /insights and /live.

Before you start#

You need the first app’s project with the production setup locked down. The checklist in Environments & going live covers that setup.

Each change on this page needs the manage scope. Spend limits also need an org manager. napalm clusters ls lists the org’s clusters. The samples write <cluster> in place of the cluster’s name.

Test the launch on a preview branch#

A load test on a preview branch runs the busiest screens against a copy of main’s rows. The test finds slow statements and missing indexes before real people arrive.

Terminal
# A preview branch with a copy of main's rows. An operation makes the copy.napalm branches create notes launch-test --preview --datanapalm operations show <operation-id> --wait # The branch's API, open to statements from sessions and keysnapalm endpoint notes --branch launch-test --enable --passthrough all # Each shard's kind, to see whether the cluster has a preview shardnapalm shards <cluster>

Because branches serve no deployed queries by name, generate the load-test client without --deployed so each request sends statement text alongside variables (the same workflow used in Develop against a personal branch). The preview branch maintains isolated sessions and service keys, so sign up your synthetic test users directly on the branch.

Where the branch runs
A cluster with a preview shard runs the branch there, so the test stays off main’s primary. Without a preview shard, the branch sits beside main and shares main’s primary.
Engines
The same engines serve main and the branch. Run a heavy test while main is quiet.
Results
GET /projects/{id}/insights with branch=launch-test lists the heaviest statements and index advice. GET /projects/{id}/live with the same branch counts the open live queries.
Capacity
The test’s speed does not predict main’s capacity because a preview shard runs on one machine with no replica and sends statement text in place of deployed queries.

Remove the branch after the test with napalm branches remove notes launch-test.

Plan for the project limits#

Four project limits hold on a cluster of any size, and scaling machines does not raise those limits.

LimitCountsPast the limit
Live queries1,000 subscriptions open at once for each GiB of engine memory, across the project’s streamsPast the limit429 live_limit_reached on a new subscription
Waiting jobs10,000 jobs for each caller. A person counts by identity and a key by token.Past the limit429 job_limit_reached. The statement’s changes are not kept.
Request body1 MiB for each requestPast the limit413 request_too_large
Result16 MiB for each answerPast the limit413 result_too_large

Every open subscription counts toward the live query limit, so usage grows with each person online. Pause live queries for off-screen content. Realtime & collaboration covers pausing subscriptions and managing the limit.

A backend that queues every person’s jobs with one service key counts as one caller. Pass each person’s token on instead. A backend service shows the pattern.

Make room under the spend cap#

Napalm refuses a new cluster, scale, split or core copy that would take the org’s machines past the spend cap. Raise the cap above the scaled cluster’s monthly price before the scale.

Terminal
# Napalm's limit, the org's cap and the alertnapalm orgs limits # A higher cap for the launch's machines and an alert under the capnapalm orgs limits --cap 800 --alert 600
--cap
A monthly ceiling in whole US dollars on the cost of the org’s machines. A scale past the cap gets 402 monthly_cap_reached. Lowering the cap stops nothing already running. none removes the cap.
--alert
The console alerts the org’s managers once the month’s charges pass this amount in US dollars. Set the alert under the cap. none removes the alert.
Napalm’s limit
Napalm sets each org’s monthly limit, which org managers cannot raise directly. A scale past the limit gets 402 monthly_limit_reached. napalm orgs limits shows the limit beside the cap.
Charges
napalm orgs charges lists the month’s charges by meter. Read the list each day of launch week.

The console’s home page sets the cap and the alert under Spend limits in the Your org section. Organization & billing lists the charges routes and the fields of POST /org/spend-limits.

Scale the cluster ahead of time#

Run napalm clusters scale during a quiet window several days ahead of launch, because scaling executes as a tracked cluster operation and resizing database members briefly pauses writes during primary switchover.

Terminal
# The cluster's engines, database machines and hold todaynapalm clusters show <cluster> # Four engines and two replicas beside each data shard's primarynapalm clusters scale <cluster> --engines 4 --replicas 2

The CLI previews every planned step in order, prompts for confirmation and streams progress to completion. Omitted flags retain their current settings, and --no-wait returns immediately so you can follow progress later with napalm operations show.

FlagSetsDuring the operation
--enginesThe number of engines behind the endpoint. Engines carry connections, statement compilation and live queries.During the operationNew engines join behind the endpoint.
--engine-memoryEach engine’s memory, like 2GiB.During the operationThe engines restart one at a time, so the endpoint keeps serving.
--replicasThe number of replicas beside each data shard’s primary. Replicas serve reads and take over in a failover.During the operationEach new replica copies the primary first.
--member-memory and --member-cpuThe memory and CPU type of every database machine. The CPU type is shared or performance.During the operationReplicas restart first. The primary restarts after a switchover, so writes pause for a moment.
--data-shardsThe number of data shards. Each new shard is laid out like main’s shard.During the operationA new shard starts empty. Data shards cannot be removed yet.

Scaling updates stateless engines first, provisions any new data shards second and resizes database members last. Newly added shards remain empty until branches or roots move onto them (see Root-partitioned shards).

A cluster with replicas serves reads from the replicas. Bookmarks keep each person’s reads current after a write. Replica read routing covers bookmarks.

A scale during another operation on the cluster gets 409 cluster_busy. The cluster page’s Topology tab in the console plans the same change and shows its monthly price before the request. Scripts call POST /clusters/{id}/scales with the whole layout.

Hold maintenance for launch week#

A hold delays Napalm’s own maintenance on the cluster for up to a week. Place the hold after the scale finishes. A new hold gets 409 cluster_busy while an operation waits or runs on the cluster.

Terminal
# Napalm's own maintenance on the cluster waits until the hold liftsnapalm clusters hold <cluster> --reason "Launch week" --for 5d # Lift the hold earlynapalm clusters hold <cluster> --remove
Waits
Nightly backups, certificate renewals and Napalm’s other maintenance on the cluster.
Still runs
A scale, a backup and other operations from the org still start. Automatic failover still runs. Archiving continues, so a restore still reaches any moment.
Length
--for takes whole hours or days, like 6h or 3d. The default is one day. The hold lifts by itself at the end. A hold lasts at most a week from placement.
Changes
Running the command again changes the end or the reason. Leaving out --reason keeps the current reason. A change does not wait for a running operation and still ends within a week of the first placement.
Backups
Without nightly backups, a restore takes longer. napalm clusters backup <cluster> takes a backup during the hold.

The cluster page’s Overview tab in the console places, changes and lifts the same hold under Maintenance hold. Clusters API documents the hold’s fields. Production monitoring gives the routine for watching the project during launch week.

Check the cluster before launch#

  1. List the cluster’s operations

    napalm operations ls <cluster> lists the clusterScale operation as completed.

  2. Show the cluster

    napalm clusters show <cluster> lists four engines and two replicas beside each primary. Every member is ready. The Hold line shows “Launch week” and the end time.

  3. Show the spend limits

    napalm orgs limits shows a cap above the cluster’s new monthly price and an alert under the cap.

  4. Count the open live queries

    GET /projects/{id}/live gives main’s subscription count beside the limit. Read the count again at the launch’s peak.

Type a word or two to search every docs page.