Skip to main content

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​

ParameterRequiredDescriptionDefault
--suspendNoSuspend the service: drop all connections and reject new ones—
--no-suspendNoResume the service—
--private-onlyNoAllow private channels only—
--no-private-onlyNoAllow both public and private channels—
--presenceNoEnable Presence—
--no-presenceNoDisable Presence—
--max-concurrent-users <n>NoMaximum concurrent users, server-side limit 15000—
--max-events-per-second <n>NoMaximum events per second—
--max-joins-per-second <n>NoMaximum joins per second—
--max-bytes-per-second <n>NoMaximum payload bytes per second—
--max-channels-per-client <n>NoMaximum channels per client—
--max-presence-events-per-second <n>NoMaximum presence events per second—
--max-payload-size-in-kb <n>NoMaximum payload size per message, in KB—
--connection-pool <n>NoDatabase connection pool size—
--postgres-changes-pool <n>NoPostgres Changes connection pool size—
-e, --env-id <envId>YesEnvironment ID—
--yesNoSkip confirmation. Required with --json and in non-interactive environments (CI, pipes)—
--jsonNoOutput 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
  • --json requires --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 1KB are rejected
  • Run get before changing settings to confirm the current values