独立的Tomcat 6.0。* + 20,000个并发连接 [英] Standalone Tomcat 6.0.* + 20,000 simultaneous connections

查看:79
本文介绍了独立的Tomcat 6.0。* + 20,000个并发连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何将Tomcat 6.0配置为可同时处理20,000个同时连接的独立Web服务器(在Windows XP上)吗?请帮助我。

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.

推荐答案

如果将其配置为使用HTTP NIO连接器并为其提供足够的内存,则理论上它必须是能够做到。

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

使用普通的HTTP连接器,性能将开始降低约1K的连接速度,然后急剧下降约5K的同时连接数,这仅仅是因为每个连接都隐式地使用了自己的线程。 HTTP NIO连接器具有足够的扩展能力,并且可以扩展单个线程,很多

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.

基本上,您要做的就是替换< a href = http://tomcat.apache.org/tomcat-6.0-doc/config/http.html rel = nofollow noreferrer> HTTP连接器的默认协议属性的 HTTP / 1.1 org.apache.coyote.http11.Http11NioProtocol

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" />

并给它足够的内存。如果连接20K,则从2GB开始。您可以在Tomcat systray工具中进行设置。

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

但是,这是一个极端情况,也取决于所使用的硬件。如果CPU和磁盘的I / O确实很高,那么我仍然建议放置第二台Tomcat服务器和群集服务器。

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.

这篇关于独立的Tomcat 6.0。* + 20,000个并发连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆