Tomcat性能调优 [英] Tomcat performance tuning

查看:112
本文介绍了Tomcat性能调优的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调整Tomcat 7的性能,该服务器配备24个核心和32 GB内存,我的测试接口是一个RESTful服务,没有任何进程(立即响应),并且server.xml的配置如下.

I am tuning the performance of Tomcat 7, the server is equipped with 24 cores and 32 GB memory, my testing interface is a RESTful service without any process(response immediately) and the configuration of server.xml is as following...

<Connector port="8088" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443"
           enableLookups="false"
           compression="off"
           maxConnections="8192"
           maxThreads="1000"
           tcpNoDelay="true"/>

和JVM配置...

-Xms8192M -Xmx16384M.

JMeter的主机是另一台与上述服务器具有相同规格的计算机. JMeter堆的配置为-Xms12218m -Xmx24426m.

The host of JMeter is another computer has same specification with above server. And the configuration of JMeter heap is -Xms12218m -Xmx24426m.

我的JMeter测试计划是240个请求同时发送到RESTful接口一次,但是我注意到,前100个响应时间的平均时间不超过50ms,但在接下来的100个响应时间中平均增加了1秒,剩下的3秒.

My JMeter test plan is 240 requests send to the RESTful interface concurrently for once, but I have noticed that, the average of response time for the first 100 is no more than 50ms but it increases to 1 sec in the next 100 and to 3 sec for the rest.

我对这种现象感到好奇,配置中是否有任何错误或建议?

I am curious about such phenomenon, is there any mistakes in the configurations or any suggestions?

谢谢.

推荐答案

您可以配置:

acceptCount="2048"

maxConnections="1024"

maxConnections与maxThreads有关系,您应该配置maxThreads使其与业务和CPU的核心编号相匹配,例如8X或16X. acceptCount是等待的连接号.

The maxConnections has relationship with maxThreads, and you should configure the maxThreads match your business and CPU's core number, such as 8X, or 16X. the acceptCount is the waiting connection number.

请注意,随着服务器硬件的性能提高,maxConnections和maxThreads越大越好.

Note that the maxConnections and maxThreads is not the bigger the better, with the performance of your Server Hardware.

这篇关于Tomcat性能调优的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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