Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many users Nodejs & Socket.io can support?

Tags:

I got a website that implements the broadcast.emit. that sends message to all users of the site. It is just the simplest implementation of socket.io but I currently having a problem. When I hit about 100 concurrent users. The nodejs server starts to lag until it hangs that I can no longer access my whole website. When we checked the server. The nodejs is taking 100% of the CPU. Is it normal?

I was wondering how many users can socket.io supports? And when this thing happen is there a way to restart the nodejs server programatically?

like image 363
3s2ng Avatar asked Apr 15 '12 11:04

3s2ng


1 Answers

I have a multiplayer card game. Socket.io maxes out my CPU at around 3000 concurrent users. This is on Intel i7 CPU. Because of this I have to run multiple node/socket.io processes to handle the load.

For 100 concurrent connections you should be fine. Perhaps you are using some VPS and CPU is shared with all the other VMs? Do you run a dedicated server?

Also, check your code. You might be doing synchronously some stuff that should go async.

like image 50
Milan Babuškov Avatar answered Sep 22 '22 08:09

Milan Babuškov