Supabase Realtime WebSockets: 10K+ Socket BEAM Tuning — SupaScale Docker Guide
Managed Supabase Pro includes 500 peak WebSockets before metering extra connections and messages. SupaScale models how Elixir BEAM scales past 10,000 sockets on 16 GB NVMe.
SupaScale minimum floor: 8 GB RAM • Sweet-spot tier: 16 GB RAM (Public vendor rates retrieved 2026-11-12).
Subscribing thousands of clients to postgres_changes (WAL CDC) on RLS-protected tables forces PostgreSQL to execute an RLS permission check per subscriber on every INSERT—saturating vCPU cores rapidly!
SupaScale Deterministic Memory Model Table: Supabase Realtime WebSockets: 10K+ Socket BEAM Tuning
| Supabase Docker Subsystem | Baseline Idle Reserve | 50K MAU Projected Reserve | Memory Role |
|---|---|---|---|
| Broadcast Ephemeral Channels (No Per-Row RLS) | 390 MB | 1.15 GB @ 10K sockets | Linear BEAM Scale |
| Presence Shared CRDT Room State | 420 MB | 1.55 GB @ 10K sockets | Higher BEAM Heap |
| Postgres Changes (Single-Slot WAL CDC) | 450 MB | CPU-bound >1.5K subs | Prefer Broadcast |
| Supabase Cloud 10K Peak + 80M Messages | $25 Pro | ~$315/mo metered | Flat KVM Wins |
SupaScale Realtime Elixir BEAM & Linux Kernel Socket Limits
# /etc/sysctl.d/99-supascale-realtime.conf
fs.file-max = 2097152
net.core.somaxconn = 65535
net.ipv4.ip_local_port_range = 1024 65535
# docker-compose.override.yml
services:
realtime:
mem_limit: 1536m
ulimits:
nofile:
soft: 1048576
hard: 1048576
environment:
ERL_MAX_PORTS: "524288"
DB_AFTER_CONNECT_QUERY: "SET search_path TO _realtime"
1. SupaScale Routing Rule: Broadcast Channels vs Single-Threaded Postgres CDC
Supabase Realtime offers three modes: Broadcast, Presence, and Postgres Changes. Because Postgres Changes reads a single wal2json replication stream and checks RLS per listener, we recommend using Broadcast events (triggered from server actions or lightweight DB triggers) whenever room fan-out exceeds 500 concurrent users.
2. Raising Kong & Realtime File Descriptors in SupaScale Docker Overrides
Default container ulimits cap open file descriptors near 1,024 to 4,096, causing Kong to drop WebSocket upgrades with HTTP 502 errors during traffic bursts. Raising nofile to 1,048,576 on both kong and realtime containers eliminates descriptor exhaustion.
3. Regional APAC & EU Latency Considerations in SupaScale Provider Matching
Interactive Presence cursors and chat rooms are sensitive to round-trip network latency. Deploying self-hosted Supabase on Singapore, Tokyo, or Frankfurt NVMe nodes keeps regional WebSocket heartbeat RTT low compared to cross-ocean cloud regions.
SupaScale Matched KVM & VDS Tiers for Supabase Realtime WebSockets: 10K+ Socket BEAM Tuning
Vultr 3.5GHz+ High Frequency NVMe (Low-Latency pgvector & Realtime) — SupaScale
From $24/mo (~612k)
Hourly billing lets you benchmark HNSW pgvector recall on 16GB/32GB HF nodes for cents.
Check Vultr High Frequency Specs for Supabase Realtime WebSockets: 10K+ Socket BEAM Tuning on SupaScale →Hostinger KVM NVMe VPS (1-Click Docker / Coolify + Supabase) — SupaScale
From $4.99/mo (~127k)
12–24 mo KVM 2 (8GB) or KVM 4 (16GB) locks lowest rate + stacks Extra 20% partner discount.
Compare Hostinger KVM VPS Options for Supabase Realtime WebSockets: 10K+ Socket BEAM Tuning on SupaScale →SupaScale rate citation: Public vendor tariffs retrieved 2026-11-12; promotional and renewal prices change — verify exact checkout pricing before ordering.