Deployments · Health checks
Health checks
The probe ComputeSphere uses to decide whether each new spherelet is ready to serve traffic. Until enough checks pass, the rollout holds — your old spherelets keep serving requests, and a broken deploy can't take production down.
How it fits the rollout
Every deployment goes through the five-phase lifecycle. The fourth phase is the health check. New spherelets must respond successfully on your configured path or port a configurable number of times before traffic shifts to them. If they don't, the rollout aborts and the old spherelets keep serving traffic.
You don't need a health check enabled for a service to deploy — but without one, the rollout assumes the spherelet is healthy the moment the process is running. Most services should have one.
Configure one
Health checks are HTTP checks: the platform requests a path on your service, and a 2xx or 3xx answer counts as healthy.
- Open your service and find the Health check card. Click Add health check, or Edit health check if one is set.
- Turn on Health checks.
- Fill in Endpoint path, Port, Initial delay and Check interval. Leave Timeout and Failure threshold blank to use the defaults below.
- Click Save, then choose whether to redeploy now. The check applies from the next deployment.
Field reference
| Field | Default | What it controls |
|---|---|---|
Endpoint path (path) | None; required | The path the check requests. Return a 2xx when the spherelet is ready, and an error status when it isn't. |
Port (port) | Service port | The port the check connects to. |
Initial delay (initial_delay_seconds) | 10 s | How long to wait after the spherelet starts before the first check. Set this above your slowest cold start. |
Check interval (period_seconds) | 30 s | Time between checks once the initial delay passes. |
Timeout (timeout_seconds) | 3 s | How long one check may take before it counts as a failure. |
Failure threshold (readiness_failure_threshold) | 3 | Failed checks in a row before the spherelet is taken out of traffic. The rollout aborts when no new spherelets are healthy. |
A working example
A minimal Express endpoint that returns OK once the database is reachable:
import express from "express";
import { pool } from "./db.js";
const app = express();
app.get("/healthz", async (_req, res) => {
try {
await pool.query("SELECT 1");
res.status(200).send("ok");
} catch {
res.status(503).send("not ready");
}
});
app.listen(process.env.PORT ?? 8080);
The point of a health check isn't "is the process alive" — Linux already tells the platform that. It's "is this spherelet ready to take real traffic?" If your service needs a database, a cache, or a downstream API to function, the health check should confirm those work too.
Next
- Lifecycle — how health checks gate traffic during rollout and rollback
- Networking — control who can reach your service once it's healthy
- Environment variables — configure your service before the health check runs