nairihar99@gmail.com
@nairihar
You have a NodeJS server with 3k requests per second
Now You have 30k requests per second
Lots of requests
NodeJS
:8000
:8001
:8002
NGINX
:3000
r1
r2
r3
r4
r5
Connections/Polling
u1
req 1
req 2
polling req 1
polling req 2
res 1
Session ID unknown
Stop balance after user's first request
Server 1 can't send data to user 2
u1 connected to s1
u1 emits to s1 for u2
u1 connect to socket
u1 emit data for u2
u2
u2 connect to socket
u2 connected to s2
Error
REDIS
subscribe
publish
Use Redis PUB/SUB with Sockets
Other Load Balancers
Thank You!
By Nairi Harutyunyan
NodeJS Load Balancing with Nginx and Redis PUB/SUB with Socket
Big fan of JavaScript