I noticed that the maximum concurrent connections to node.js
with socket.io
is about 1000 connections.
Is it possible to increase that number with ulimit
command on linux? setting the ulimit
to 65536 can solve my problem?
As we saw in the performance section of this article, a Socket.IO server can sustain 10,000 concurrent connections.
The theoretical limit is 65k connections per IP address but the actual limit is often more like 20k, so we use multiple addresses to connect 20k to each (50 * 20k = 1 mil). I then run the web server as root by typing sudo -i followed by ulimit -n 1024000 and then node examples/WebSocket. js (in the uWebSockets.
Load benchmarks Here we can see that the HTTP benchmark peaks at about~950 requests per second while Socket.io serves about ~3900 requests per second.
With nearly 55k stars on GitHub and about 3 million downloads on npm weekly, Socket.IO is a great library to keep an eye on in 2022. The documentation is very straightforward, meaning even an inexperienced developer should be able to get started in little to no time.
Set the ulimit
for the user account node.js is running on to a higher number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With