You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Broadcast to specific streamsseService.broadcastToStream("123","stream.created",data)↓Filter clients: subscriptionincludes"123"or"*"↓Sendtomatchingclients// Broadcast to usersseService.broadcastToUser("GABC...","stream.created",data)↓Filter clients: subscriptionincludes"user:GABC..."or"*"↓Sendtomatchingclients// Broadcast to allsseService.broadcast("stream.created",data)↓Sendtoallconnectedclients
Memory & Performance
Single Instance Capacity:
Connections Memory CPU (idle) CPU (1K events/s)
─────────────────────────────────────────────────────────
100 1 MB <1% <5%
1,000 10 MB <1% ~10%
10,000 100 MB ~2% ~30%
50,000 500 MB ~5% ~80%
Bottlenecks:
- Network I/O (primary)
- Memory per connection (~10KB)
- Event serialization (JSON.stringify)
Optimization:
- Use Redis for multi-instance
- Implement connection pooling
- Add message batching for high-frequency events