Endpoints
Suspend-on-idle Postgres frontends — types, lifecycle, and wake semantics.
An endpoint is the Postgres process that accepts client connections. Endpoints are ephemeral: they suspend when idle, wake on first packet, and run on the project's separated storage layer. Pay only for the seconds compute is actually running.
Types
| Type | Writes? | When to use |
|---|---|---|
rw | Yes | The default. App traffic, migrations, anything that mutates. One rw endpoint per branch is plenty for typical workloads. |
ro | No | Read replicas. Multiple ro endpoints can attach to the same branch and share storage; their local caches stay independent. Use to isolate analytics traffic from app traffic. |
Both types attach to exactly one branch. An endpoint cannot move to a different branch; create a new endpoint on the target branch instead.
Suspend on idle
Endpoints suspend after a configurable window of no client activity.
The default is 300 seconds (5 minutes). The minimum is 60 seconds;
the maximum is 86 400 seconds (24 hours). Set suspend_after_seconds
at create time, or update an existing endpoint to take effect on
its next idle period.
While suspended:
- The compute pod is gone. No CPU, no memory billed.
- Storage is unaffected — your data is durable in the pageserver.
- The endpoint id and connection string remain valid.
Wake
Sending a packet to a suspended endpoint wakes it. Cold-start latency is typically 300–500 ms once the cluster has the warm pageserver cache; the very first wake after a long idle (or after a fresh project) can take 10–30 seconds while the pageserver page cache warms. Standard Postgres drivers do not see this as a timeout in typical configurations — see Troubleshooting if you do.
State machine
An endpoint transitions through:
Pending → Starting → Running → Stopping → Stopped → (Failed)- Pending — control plane has accepted the create request and is scheduling the compute pod. If you see an endpoint stuck here for more than a few seconds, see Troubleshooting.
- Starting — the compute pod is up; Postgres is initialising and replaying WAL up to the branch's HEAD.
- Running — accepting client connections.
- Stopping — idle window elapsed; draining connections and flushing local state.
- Stopped — suspended. Waiting for the next packet to wake.
- Failed — terminal error. The endpoint card surfaces the reason; rare, but happens when scheduling fails or the compute image cannot start.
Connection URI
The wire format is documented in Connection strings:
postgresql://<role>:<pwd>@<endpoint_id>.kisenon.com:5432/<database>?sslmode=requireThe hostname is derived from the endpoint id, not the project id — each endpoint terminates TLS independently. TLS is required.
Create
keon endpoints create --branch <branch-id> --type rwOptional flags:
--suspend-after-seconds <n>to override the default suspend window.--type rofor a read-only endpoint.
The CLI returns the endpoint id and the connection string. The
endpoint is Running and ready to accept connections within a few
seconds of the call returning.
Delete
keon endpoints delete <endpoint-id>Open client connections are dropped. The endpoint id is retired and its DNS hostname stops resolving. The branch and its data are unaffected.
Related
- Branches — what an endpoint attaches to.
- Connection strings — wire format detail.
- Troubleshooting — stuck states, cold-start timeouts, and friends.