简体   繁体   English

Tomcat的高CPU使用率

[英]High CPU Usage by Tomcat

I used Visualvm to analyze high cpu usage for tomcat 7 on my server, following is the top usage : 我使用Visualvm分析了服务器上tomcat 7的高CPU使用率,以下是最常见的用法: 在此处输入图片说明 my configuration in server.xml file: 我在server.xml文件中的配置:

<Connector port="80" protocol="HTTP/1.1"  connectionTimeout="20000"
        redirectPort="8443" maxThreads="800" minSpareThreads="150" URIEncoding="UTF-8"/>

please help me find what cause this problem and how solve it . 请帮助我寻找造成这个问题的原因和解决方法。

Thanks in advance. 提前致谢。

There is not sufficient information / evidence to explain what is going on. 没有足够的信息/证据来解释正在发生的事情。 This could be a direct result of having an excessive number of request threads, or it could underlying problem in your webapp that is exacerbated by the number of threads. 这可能是请求线程数量过多的直接结果,也可能是您的webapp中潜在的问题,线程数量加剧了该问题。

The only (possible) clue I can pull out of this is that (maybe) the high TakeQueue value means something is doing a lot of internal request forwarding. 我可以从中得出的唯一(可能)线索是(也许)高TakeQueue值意味着某些事情正在做很多内部请求转发。

I suggest: 我建议:

  • Reduce the number of threads by a factor of 10 or more to see if that makes any difference. 将线程数减少10倍或更多,以查看是否有任何区别。 It is a bad thing to have a huge number of threads active at the same time. 同时具有大量活动线程是不好的。 As in ... bad for system performance. 如...不利于系统性能。

  • Use visualvm to try tp work out what the worker threads are doing. 使用visualvm尝试tp找出工作线程正在做什么。

  • See if you can spot errors or unusual behaviour in the tomcat logs, and the request logs. 查看您是否可以在tomcat日志和请求日志中发现错误或异常行为。 (Turn the logging levels up to the max ...) (将日志记录级别提高到最大值...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM