tcb db pg realtime set
Update the Realtime settings of a PG mode environment: suspend or resume the service, channel access policy, Presence switch, rate limits, and connection pool sizes.
Version
The tcb db pg realtime commands are available since v3.9.0.
Usage
tcb db pg realtime set -e <envId> [options]
Only explicitly specified settings change; everything else keeps its current value. With no setting passed, the command changes nothing and does not fail.
Parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
--suspend | No | Suspend the service: drop all connections and reject new ones | — |
--no-suspend | No | Resume the service | — |
--private-only | No | Allow private channels only | — |
--no-private-only | No | Allow both public and private channels | — |
--presence | No | Enable Presence | — |
--no-presence | No | Disable Presence | — |
--max-concurrent-users <n> | No | Maximum concurrent users, server-side limit 15000 | — |
--max-events-per-second <n> | No | Maximum events per second | — |
--max-joins-per-second <n> | No | Maximum joins per second | — |
--max-bytes-per-second <n> | No | Maximum payload bytes per second | — |
--max-channels-per-client <n> | No | Maximum channels per client | — |
--max-presence-events-per-second <n> | No | Maximum presence events per second | — |
--max-payload-size-in-kb <n> | No | Maximum payload size per message, in KB | — |
--connection-pool <n> | No | Database connection pool size | — |
--postgres-changes-pool <n> | No | Postgres Changes connection pool size | — |
-e, --env-id <envId> | Yes | Environment ID | — |
--yes | No | Skip confirmation. Required with --json and in non-interactive environments (CI, pipes) | — |
--json | No | Output JSON | — |
Paired switches are mutually exclusive. Passing --suspend with --no-suspend, --private-only with --no-private-only, or --presence with --no-presence fails immediately.
Numeric parameters accept decimal non-negative integers only; the upper bounds are validated by the server.
Examples
# Adjust concurrency and rate limits
tcb db pg realtime set -e <envId> --max-concurrent-users 500 --max-events-per-second 200 --yes
# Suspend the service and drop all connections
tcb db pg realtime set -e <envId> --suspend --yes
# Disable Presence and cap the payload size
tcb db pg realtime set -e <envId> --no-presence --max-payload-size-in-kb 1024 --yes
# Allow private channels only
tcb db pg realtime set -e <envId> --private-only --yes
Notes
- In an interactive shell the command asks for confirmation and shows how many settings will change; existing connections may be dropped
- Changing
Suspend(either direction) disconnects all existing WebSocket connections, so clients must reconnect --jsonrequires--yes; environments that cannot prompt for confirmation (CI, pipes) also require--yes, otherwise the command fails instead of looking successful without doing anything- Numeric parameters are validated as integers, so decimals, negative numbers, and unit-suffixed values such as
1KBare rejected - Run
getbefore changing settings to confirm the current values
Related Commands
- Enable the Realtime service
- Query Realtime settings
- Client integration: Realtime quick start