HTML5 websockets: max number of open connections?

There isn’t a standard specification of max-connections default value for browsers.It depends on implementation [0]. Furthermore using more than a web-socket per browsing session for the same application seems overkill since you can use pub/sub channels.

Bottleneck for connections usually is at server side. Web-socket is a upgrade to HTTP so connections are “just” upgraded HTTP(TCP) connections [1].HTTPS and WSS add just a security layer to the normal connection.They are not a different connection [2]. In your case check maxConnections (and maxThreads) [3] and your Operating System maximums [4][5]. If your concurrent connections reach tens of thousands maybe you should start thinking on load balancing or clustering [6].

[0]https://code.google.com/p/chromium/issues/detail?id=85323

[1]http://en.wikipedia.org/wiki/WebSocket

[2]http://en.wikipedia.org/wiki/HTTP_Secure

[3]http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

[4]https://serverfault.com/questions/10852/what-limits-the-maximum-number-of-connections-on-a-linux-server

[5]https://superuser.com/questions/251596/is-there-a-hard-limit-of-65536-open-tcp-connections-per-ip-address-on-linux

[6]http://tomcat.apache.org/tomcat-7.0-doc/config/cluster.html

More about high concurrency: http://www.kegel.com/c10k.html

Leave a Comment