Linux – Comet and node.js – How many simultaneous connections do we expect on EC2 servers?

Comet and node.js – How many simultaneous connections do we expect on EC2 servers?… here is a solution to the problem.

Comet and node.js – How many simultaneous connections do we expect on EC2 servers?

For Comet servers running on node.js – how many concurrent connections do we expect from EC2 servers?

Has anyone done this before and found a reasonable limit?

Our particular application only needs to push data to clients fairly infrequently, and what worries us more is the maximum number of simultaneous connections per server. I think we’re looking somewhere between 200k – 500k, and I’m trying to figure out if cometd can work without a huge server farm….

Solution

If you’re running Linux, learn about /proc/sys/net/ipv4

Especially net.ipv4.netfilter.ip_conntrack_max will let you increase the maximum number of open connections, but you will run into other problems when you start inserting very large numbers. For example, you may need to reduce your orphan_retries because you are statistically more likely to have orphans. For very large numbers, it is entirely possible that the kernel lookup algorithm will slow down significantly. You need to adjust your TCP settings carefully.

If I were in your position, I would compare at least two operating systems, such as Linux and FreeBSD or OpenSolaris/Illumos.

On FreeBSD, you need to change the settings in /boot/loader.conf

On OpenSolaris/Illumos, you need to read the documentation for the ndd command.

Related Problems and Solutions