Limits
Technical limits for EdgeBase Room (server-authoritative multiplayer state channels).
Room Capacity
| Limit | Default | Configurable | Notes |
|---|---|---|---|
| Max players per room | 100 | Yes | rooms.*.maxPlayers (max 32,768) |
| Max state size | 1 MB | Yes | rooms.*.maxStateSize (min 1 KB) — shared + all player states combined |
| State warning threshold | 80% of maxStateSize | No | ROOM_STATE_WARNING event fired |
| Max dot-path depth | 5 levels | No | e.g. a.b.c.d.e for nested state operations |
Timing
| Limit | Default | Configurable | Notes |
|---|---|---|---|
| Auth timeout | 5,000 ms | No | Connection closed if no auth message |
| Action handler timeout | 5,000 ms | No | Per onAction execution |
| Reconnect grace period | 30,000 ms (30s) | Yes | rooms.*.reconnectTimeout (0 = immediate onLeave) |
| Delta batch window | 50 ms | No | State changes are buffered before broadcast |
| Delta throttle | 10 msg/s | No | Maximum delta broadcast rate |
| Room idle timeout | 300 seconds | No | Empty room hibernation delay |
State Persistence
| Limit | Default | Configurable | Notes |
|---|---|---|---|
| State save interval | 60 seconds | Yes | rooms.*.stateSaveInterval |
| State TTL | 24 hours | Yes | rooms.*.stateTTL — safety net for orphaned storage |
Rate Limiting
| Limit | Default | Configurable | Notes |
|---|---|---|---|
| Action rate limit | 10 actions/sec | Yes | rooms.*.rateLimit.actions (token bucket, min 1) |
| Pending connections per IP | 5 | No | WebSocket DDoS gate |
| Pending connection TTL | 10 seconds | No | Auto-expires; no cleanup needed |
Messaging
| Feature | Limit | Notes |
|---|---|---|
sendMessage | Broadcast to all | options.exclude to skip specific users |
sendMessageTo | Unicast to one user | |
| Named timers | Alarm multiplexer | Persisted to DO Storage; survives hibernation |
Lifecycle
| Hook | Behavior | Notes |
|---|---|---|
onJoin | Can throw to reject | |
onLeave | reason: 'leave' / 'disconnect' / 'kicked' | |
onDestroy | Stored state immediately deleted | |
onAction | 5s timeout, try/catch protected |
Room config validation
maxPlayers must be between 1 and 32,768. maxStateSize minimum is 1 KB. reconnectTimeout must be non-negative. rateLimit.actions must be at least 1. Invalid values cause a config validation error at deploy time.