Tuesday, February 16, 2016

Load testing web sockets with Node.js - Fine tuning TCP/IP on Windows

Load testing WebSockets with Node.js


I was doing a load testing for a socket.io server. After creating a small client in Node.js using socket.io-client I faced with a limit of about 16K connections trying to run it on Windows 7.

It turned out that by default, dynamic ports are allocated between ports 49152 and 65535 (for a total of 16384 ephemeral ports). Using netsh allows to set both the starting port and port range.


 netsh int ipv4 set dynamicportrange protocol=tcp start=1025 num=64511


After running the command I was able to run a Node.js cluster of 8 processes each establishing 5000 connections. That makes 40K connections in total.

I also found a good article about stress testing node.js application

No comments:

Post a Comment