2. Plan of the presentation
- The reference code
- A little bit better, but still the usual suspects
- The first real pain: Scalability
- Others things to consider
3. Plan of the presentation
- The reference code
- A little bit better, but still the usual suspects
- The first real pain: Scalability
- Others things to consider
10. The reference code
you can make it reliable
- But then, the handshake is stretched to up to 10 s …
11. Plan of the presentation
- The reference code
- A little bit better, but still the usual suspects
- The first real pain: Scalability
- Others things to consider
13. Better Design
Scalability
• Bandwidth intensive instances in AWS?
• Socket intensive instances in AWS?
• Socket.io 0.9 not CPU scalable
• Horizontal scalability
• Node fails often
• B-E update deployment = downtime
14. Plan of the presentation
- The reference code
- A little bit better, but still the usual suspects
- The first real pain: Scalability
- Others things to consider
15. Big Pain: Scalability
CPU Scalability
• Bandwidth intensive instances in AWS?
• BIG instance with HVM (c3.8xl)
• Socket.io 0.9 not CPU scalable
• socket.io 0.9 scales by using a store
replicate the data object to each
instance of the signaling server.
• It just replicates load everywhere... All
instances are doing the same work
essentially
• Socket.io 1.x changes the way the
store works. The stores become and
event bus, and each instance run
independently only handling clients
connected to them.
• they all listen to all events however so
two clients connected to different
instances can still talk!
core
Redis
store
16. Big Pain: Scalability
Horizontal Scalability
• Horizontal scalability• Business as usual: reverse proxy load
balancing.
• Usual suspect: NGINX
Redis
store
NGINX
17. Big Pain: Scalability
Node Zombification
• Node fails often
• B-E update deployment = downtime?
core
Cluster API is nice, Forever is nice,
pm2 is better
• Keep alive
• Clustering / load balancing
• Log aggregation
• Terminal monitoring
• …
18. Plan of the presentation
- The reference code
- A little bit better, but still the usual suspects
- The first real pain: Scalability
- Others things to consider
19. Advanced infrastructure: Others
- Session management
- Auth
- Usage
- Payment
Keys to state of the art webRTC infrastructure
- MCUs
- TURN/STUN
Notas del editor
Mcu -> advanced features: bandwidth, recording, …. And scalability
TURN/STUN: key to connectivity
Both really hard to load balance, with specific heuristics