folkwaysDocs
Realtime API

Limits

Protocol limits, rate limits, retention and naming rules of the Realtime API, with their defaults.

Clients learn the limits in force when they connect, in Welcome.limits. Read them from there rather than hard-coding them. For what Folkways doesn't do at all, see Current limitations.

Protocol

LimitDefaultMeaning
max_frame_bytes65,536Largest packet you may send: a WebSocket message or HTTP body
max_payload_bytes61,440Largest payload, on every package; lower if the segment or rule sets it
max_frames_per_packet64Frames per packet
max_subscriptions1,000Subscriptions per connection
max_topic_bytes255Longest topic name
max_headers16Headers per event
heartbeat_ms30,000How often to ping
idle_timeout_ms90,000Silence before the connection is closed

Names

ItemRule
Topic nameASCII levels separated by /, each of A-Z a-z 0-9 . _ ~ : @ = + -; at most 16 levels and 255 bytes. $ names are reserved
Event name1–64 bytes of UTF-8
Identity (sub)At most 256 bytes; not starting with anon:. One topic level for personal topics and presence
Device labelAt most 64 bytes

Retention and state

ItemDefault
Stream history per topic5 MiB (the rule's retention), at most 24 hours
KV value lifetimeUntil replaced or deleted, unless a TTL is set
Signal lifetime5 seconds
KV values and signals per topic10,000
Idempotency window10 minutes, 10,000 keys per topic
Personal topic history256 KiB per user, at most 24 hours
Presence status data1,024 bytes of JSON
Members per private topic10,000; 1,000 per request
DM members2 to 50
Token lifetime15 minutes at most
Long-poll wait25 seconds at most; 100 events by default, 1,000 at most

Rate limits

Rate limits come from the segment's rate preset, scaled by the connections your package allows, and lowered by any overrides. They are announced in Welcome.limits; a value of 0 means not announced, so rely on RateLimited and Flow instead.

LimitMeaning
publish_per_sec, publish_burstPublishes per second from one connection, and the burst above it
topic_publish_per_sec, topic_publish_burstPublishes per second into one topic, from everyone
segment_publish_per_sec, segment_publish_burstPublishes per second across the segment
inbound_bytes_per_sec, outbound_bytes_per_secBytes per second into and out of the segment
max_subscribers_per_topicSubscribers one topic holds at once
subscribes_per_min, topic_creates_per_min, new_connections_per_minPer minute, across the segment

Over a rate limit, the request gets RateLimited with retry_after_ms and nothing is published; the connection stays open. Over the outbound limit, every event is still delivered and publishers are slowed with Flow.

Backend endpoints (DMs, members, kick, revoke) share a per-segment budget: one unit per request (per member for DMs), refilling at the segment's per-connection publish rate and holding up to 64.

Package allowances

Connections, monthly messages, monthly data transfer, topics and segments are set by your package. See Usage and limits.

On this page