[ACCEPTED]-What's the maximum count of active websocket connections supported by tomcat 7.0-websocket

Accepted answer
Score: 15

TO reach the max alive websocket connections 8 in Tomcat, the following config changes 7 need to be done.

  1. {CATALINA_HOME}/conf/server.xml

    <Connector connectionTimeout="-1" port="8080" 
           redirectPort="8443" maxConnections="100000" acceptCount="300"/>
  2. Check the number of ports 6 which are available for use on the machiine 5 where Tomcat is deployed:

    $ cat /proc/sys/net/ipv4/ip_local_port_range

    Change this from 4 50 to 65535.

    $ sysctl -w net.ipv4.ip_local_port_range="500   65535"

The above configuration changes 3 allow around ~50k live connections in a 2 2GB Intel Core i5 machine provided the server 1 and client are running on different machines.

Score: 3
  1. The upper limit is the number of TCP connections your server can support.
  2. The default enforced limit will depend on the connector you are using - information that you failed to provided. For NIO and APOR/native you'll want to increase maxConnections. For bIO you;'ll want to increase maxThreads.
  3. That depends on the load balancer you are using - again information you failed to provide.


Score: 0

The total number of websocket connections 7 are determined by number of open file descriptors 6 permitted by OS on which websocket server( tomcat 5 instance in this case) is running.On a unix 4 machine we have a hard limit of 75000 file 3 descriptors but I am not sure if there is 2 a Hard limit on tomcat's ability to spawn 1 new sockets

More Related questions