Help: Scaling Node.js Socket.io on EC2 Disconnect Post 11K Concurrent Users

https://news.ycombinator.com/item?id=37779605
by RekarBotany • 3 years ago
1 1 3 years ago

We have an API server developed using NodeJS for a game, and we use Socket.IO to connect to the client side (React Native), Users connect daily for 3 minutes at a specific time, But the servers start to disconnect users when we reach around 11,000 concurrent users.

Here's a brief on our setup:

Server: AWS EC2 (c5n.xlarge) with 4 vCPU and 10GB memory. Process Management: Utilizing PM2, distributing the load across 5 different ports. Load Balancing: AWS ALB for traffic management. AWS monitoring shows the EC2 CPU utilization not exceeding 6%. However, monitoring through PM2 shows spikes in CPU usage (to 100% or 105% for under a second) during game sessions, after which the respective node drops all traffic, triggering a wave of disconnections.

I would appreciate your help

Related Stories

Loading related stories...

Source preview

news.ycombinator.com