tomcat的高并发配置

来源:互联网 发布:代理商注册域名侵权 编辑:程序博客网 时间:2024/06/01 10:24

在tomcat目录下额server.xml中配置。

<Executor name="tomcatThreadPool" //线程池namePrefix="catalina-exec-"        maxThreads="1500" //最多创建的线程minSpareThreads="50"//最少保留的线程数/>//把这个标签注释放开    <!-- A "Connector" represents an endpoint by which requests are received         and responses are returned. Documentation at :         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)         Java AJP  Connector: /docs/config/ajp.html         APR (HTTP/AJP) Connector: /docs/apr.html         Define a non-SSL HTTP/1.1 Connector on port 8080        <Connector port="8080" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443"disableUploadTimeout="true" useBodyEncodingForURI="true" URIEncoding="utf-8"/>-->//注释掉原来的connector    <!-- A "Connector" using the shared thread pool-->    <!---->    <Connector executor="tomcatThreadPool"               port="8080" protocol="HTTP/1.1"               connectionTimeout="20000"               redirectPort="8443" URIEncoding="utf-8" />//放开这段注释    

0 0