How-to

Pre-warmed pools

Dual-pool optimization — voice agent processes and Daily.co rooms pre-warmed at startup to reduce per-session latency from ~8 s to ~3 s.

Every new voice session pays a tax: spawning a Python subprocess and creating a Daily room each take a few seconds. Pre-warming a small pool of each flips that cost from the user-facing connect path to a background replenish task. Connect time drops from ~8 s to ~3–4 s.

Developers: this is already on for you

Pools are part of Breeze Buddy’s managed infra — every lead you push through the Leads API already benefits from pre-warming. This page is for operators tuning capacity. As a developer you don’t need to do anything; read on if you want to understand the knobs we expose to ops.

Prerequisites

  • Daily.co API credentials (DAILY_API_KEY, DAILY_API_URL).
  • Container orchestration that supports long-running subprocesses (Kubernetes, Docker).
  • PostgreSQL reachable for session tracking.
  • Understanding of environment-driven config — see Environment variables.

How it works

At startup the server initializes two pools:

  1. Voice agent processes — Python subprocesses that host the Pipecat pipeline. Each takes ~5–6 s to spawn.
  2. Daily rooms — pre-created rooms with owner/guest tokens. Each call takes ~1–2 s against the Daily API.

New sessions pull a ready process and a ready room in ~0.05 s. A background task replenishes each pool as items are consumed. Token expiry is checked on assignment and refreshed automatically.

Key settings

Env varDefaultControls
VOICE_AGENT_POOL_SIZE3Initial and replenishment target for voice-agent processes.
VOICE_AGENT_MAX_POOL_SIZE3Hard cap on the voice-agent pool.
DAILY_ROOM_POOL_SIZE5Initial and replenishment target for Daily rooms.
DAILY_ROOM_MAX_POOL_SIZE5Hard cap on the room pool.
DAILY_API_KEYDaily API credential.
DAILY_API_URLhttps://api.daily.coDaily API base URL.

Example config

.env
bash
VOICE_AGENT_POOL_SIZE=3
VOICE_AGENT_MAX_POOL_SIZE=3
DAILY_ROOM_POOL_SIZE=5
DAILY_ROOM_MAX_POOL_SIZE=5
DAILY_API_KEY=dvc_xxx
DAILY_API_URL=https://api.daily.co

Operational notes

  • Burst exhaustion — if both pools are drained, new sessions fall back to on-demand creation. User-visible latency returns to ~8 s but the session still completes.
  • Daily API rate limits — heavy replenishment may hit Daily’s rate limits. Watch for 429s in the logs; reduce the room pool size if you see them.
  • Token expiry — automatic refresh handles expired Daily tokens. If you see repeated “exp-token” errors, check Daily API credentials.
  • Pod restarts — each pod initializes its own pool. Rolling restarts briefly reduce aggregate pool capacity; time them during low-traffic windows.
  • Health endpoints/agent/voice/automatic/pool/status and /agent/voice/automatic/pool/rooms/status expose live pool counts for monitoring.

Tuning for your traffic

Pool sizes are per pod. With 10 pods and DAILY_ROOM_POOL_SIZE=5 you have 50 ready rooms system-wide. Size pools for peak arrival rate × session startup time — not total concurrent sessions.

Next steps

Was this helpful?