开发者

Standalone Tomcat 6.0.* + 20,000 simultaneous connections

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.开发者_如何学JAVA


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜