Standalone Tomcat 6.0.* + 20,000 simultaneous connections

爱⌒轻易说出口 提交于 2019-12-05 03:39:16

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/1795005/standalone-tomcat-6-0-20-000-simultaneous-connections

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!