views:

165

answers:

1

Does anyone know how to configure Tomcat 6.0 as a standalone web server (on Windows XP) that can handle 20,000 simultaneous connections? Please help me.

+4  A: 

If you configure it to use the HTTP NIO connector and give it enough memory, it must in theory be able to do so.

With the normal HTTP connector, the performance will start to slowdown around 1K connections and then drastically drop around 5K simultaneous connections, simply because each connection implicitly uses its own thread. The HTTP NIO connector has enough with a single thread which scales much, much better.

Basically all you need to do is to replace the HTTP connector's default protocol attribute of HTTP/1.1 with org.apache.coyote.http11.Http11NioProtocol:

<Connector
    protocol="org.apache.coyote.http11.Http11NioProtocol"
    port="80"
    redirectPort="8443"
    connectionTimeout="20000"
    compression="on" />

And give it enough memory. With 20K connnections, start with 2GB. You can set it in the Tomcat systray tool.

This is however an edge case which is also dependent on the hardware used. If the CPU's and disk I/O gets really high, then I'd still recommend to place a 2nd Tomcat server and cluster the servers.

BalusC