解决Windows Server上的高CPU使用率 [英] Troubleshoot High CPU Usage on Windows Server

查看:354
本文介绍了解决Windows Server上的高CPU使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有基于J2EE的Web应用程序。间歇性地,我们在生产环境中面临着很高的CPU使用率(80-90%)。
我们无法在质量检查环境中复制它。

We have J2EE based web application. Intermittently we are facing high CPU usage (80-90%) on our production environment. We are unable to replicate it on our QA environment.

生产环境:Windows 2012 Server(64位),JDK 1.8(64位)

Production Environment: Windows 2012 Server (64 bit), JDK 1.8 (64 bit)

对于故障排除,我们已采取线程转储。
它显示总共215个线程。

For troubleshooting we have taken thread dump. It shows total 215 threads.

111 threads are in WAITING status
34 threads are in RUNNABLE status
67 threads are in TIMED_WAITING status
3 threads are in BLOCKED status

如何


2016-03-01 11:07:52全线程转储Java HotSpot(TM)64位服务器VM
(25.5-b02混合模式):

2016-03-01 11:07:52 Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.5-b02 mixed mode):

Thread-739969-线程t @ 807668 java.lang.Thread.State:在Java.lang.Object.wait(本地方法)上等待

-在< 229fc226>上等待(组织apache.solr.util.ConcurrentLRUCache $ CleanupThread)在
java.lang.Object.wait(Object.java:502)在
org.apache.solr.util.ConcurrentLRUCache $ CleanupThread.run(ConcurrentLRUCache。 java:604)

"Thread-739969" - Thread t@807668 java.lang.Thread.State: WAITING at java.lang.Object.wait(Native Method) - waiting on <229fc226> (a org.apache.solr.util.ConcurrentLRUCache$CleanupThread) at java.lang.Object.wait(Object.java:502) at org.apache.solr.util.ConcurrentLRUCache$CleanupThread.run(ConcurrentLRUCache.java:604)

锁定的可拥有同步器:
-无

Locked ownable synchronizers: - None

Thread-739968-线程t @ 807667 java.lang.T hread.State:在java.lang.Object.wait(本机方法)上等待

-在< 5a578345>(org.apache.solr.util.ConcurrentLRUCache $ CleanupThread)上等待b java.lang.Object.wait(Object.java:502)在
org.apache.solr.util.ConcurrentLRUCache $ CleanupThread.run(ConcurrentLRUCache.java:604)

"Thread-739968" - Thread t@807667 java.lang.Thread.State: WAITING at java.lang.Object.wait(Native Method) - waiting on <5a578345> (a org.apache.solr.util.ConcurrentLRUCache$CleanupThread) at java.lang.Object.wait(Object.java:502) at org.apache.solr.util.ConcurrentLRUCache$CleanupThread.run(ConcurrentLRUCache.java:604)

锁定的拥有者同步器:
-无

Locked ownable synchronizers: - None

Thread-739963-线程t @ 807662 java.lang.Thread.State:等待$ java.lang.Object.wait(本机方法)上的b
$ b-等待< 20851ef7>(org.apache.solr.util.ConcurrentLRUCache $ CleanupThread)在
java.lang.Object .wait(Object.java:502)在
org.apache.solr.util.ConcurrentLRUCache $ CleanupThread.run(ConcurrentLRUCache.java:604)

"Thread-739963" - Thread t@807662 java.lang.Thread.State: WAITING at java.lang.Object.wait(Native Method) - waiting on <20851ef7> (a org.apache.solr.util.ConcurrentLRUCache$CleanupThread) at java.lang.Object.wait(Object.java:502) at org.apache.solr.util.ConcurrentLRUCache$CleanupThread.run(ConcurrentLRUCache.java:604)

已锁定拥有的同步器:
-无

Locked ownable synchronizers: - None

Thread-739962-线程t @ 807661 java.lang.Thread.State:在Java上等待
。 lang.Object.wait(Native Method)
-等待&l t; 35061b89>(
的org.apache.solr.util.ConcurrentLRUCache $ CleanupThread)java.lang.Object.wait(Object.java:502)在org.apache.solr.util的
。 ConcurrentLRUCache $ CleanupThread.run(ConcurrentLRUCache.java:604)

"Thread-739962" - Thread t@807661 java.lang.Thread.State: WAITING at java.lang.Object.wait(Native Method) - waiting on <35061b89> (a org.apache.solr.util.ConcurrentLRUCache$CleanupThread) at java.lang.Object.wait(Object.java:502) at org.apache.solr.util.ConcurrentLRUCache$CleanupThread.run(ConcurrentLRUCache.java:604)

锁定的可拥有同步器:
-无

Locked ownable synchronizers: - None

Thread-739960-线程t @ 807659 java.lang.Thread.State:在java.lang.Object.wait处等待
(本机方法)
-在< 3491a931>上等待org.apache.solr.util.ConcurrentLRUCache $ CleanupThread)at
java.lang.Object.wait(Object.java:502)at
org.apache.solr.util.ConcurrentLRUCache $ CleanupThread.run( ConcurrentLRUCache.java:604)

"Thread-739960" - Thread t@807659 java.lang.Thread.State: WAITING at java.lang.Object.wait(Native Method) - waiting on <3491a931> (a org.apache.solr.util.ConcurrentLRUCache$CleanupThread) at java.lang.Object.wait(Object.java:502) at org.apache.solr.util.ConcurrentLRUCache$CleanupThread.run(ConcurrentLRUCache.java:604)

锁定的可拥有同步器:
-无

Locked ownable synchronizers: - None

Thread-739959 -线程t @ 807658 java.lang.Thread.State:在java.lang.Object.wait(本机方法)处等待

-等待< 6395c27d>(org.apache.solr。 util.ConcurrentLRUCache $ CleanupThread)在
java.lang.Ob在
处ject.wait(Object.java:502)org.apache.solr.util.ConcurrentLRUCache $ CleanupThread.run(ConcurrentLRUCache.java:604)

"Thread-739959" - Thread t@807658 java.lang.Thread.State: WAITING at java.lang.Object.wait(Native Method) - waiting on <6395c27d> (a org.apache.solr.util.ConcurrentLRUCache$CleanupThread) at java.lang.Object.wait(Object.java:502) at org.apache.solr.util.ConcurrentLRUCache$CleanupThread.run(ConcurrentLRUCache.java:604)

锁定的可拥有同步器:
-无

Locked ownable synchronizers: - None

httpShardExecutor-3-thread-57429-processing- {core = actionscomments,
copy = core_node1,
ShardRequest.shards = s1.asite.com:8983 // solr // actionscomments | s1r1.asite.com:8983 // solr // actionscomments,
node_name = 10.120.112.31:8983_solr,shard = shard1 ,
collection = actionscomments,
ShardRequest.urlList = [ http :////s1r1.asite.com:8983 // solr // actionscomments
http:////s1.asite.com:8983//solr//actionscomments] }-线程t @ 807648
java.lang.Thread。状态:在
java.net.SocketInputStream.socketRead0(本机方法)处为RUNNABLE在java.net.SocketInputStream.read(SocketInputSt ream.java:150)在
处java.net.SocketInputStream.read(SocketInputStream.java:121)在
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160) org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84)的
org.apache.http.impl.io.SocketInputBuffer的
。 isDataAvailable(SocketInputBuffer.java:95)
at
org.apache.http.impl.AbstractHttpClientConnection.isStale(AbstractHttpClientConnection.java:310)
at
org.apache.http。 impl.conn.ManagedClientConnectionImpl.isStale(ManagedClientConnectionImpl.java:158)

org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:433)

org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82 )
at
org.apache.http.impl.clie nt.CloseableHttpClient.execute(CloseableHttpClient.java:107)

org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)

org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:466)
at
org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java :235)
处的
org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:227)

org.apache.solr.client .solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:376)
at
org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:328)

org.apache.solr.handler.component.HttpShardHandlerFactory.makeLoadBalancedRequest(HttpShardHandlerFactory.java:246)在
org.apache.solr.handler.component.HttpShardHandler $ 1.call(HttpShardHandler) .java:221)

org.apache.solr.handler.component.HttpShardHandler $ 1.cal l(HttpShardHandler.java:183)
在java.util.concurrent.FutureTask.run(FutureTask.java:266)在
java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java: 511)
在java.util.concurrent.FutureTask.run(FutureTask.java:266)在
org.apache.solr.common.util.ExecutorUtil $ MDCAwareThreadPoolExecutor $ 1.run(ExecutorUtil.java:148) )

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java :617)java.lang.Thread.run(Thread.java:745)上的

"httpShardExecutor-3-thread-57429-processing-{core=actionscomments, replica=core_node1, ShardRequest.shards=s1.asite.com:8983//solr//actionscomments|s1r1.asite.com:8983//solr//actionscomments, node_name=10.120.112.31:8983_solr, shard=shard1, collection=actionscomments, ShardRequest.urlList=[http:////s1r1.asite.com:8983//solr//actionscomments, http:////s1.asite.com:8983//solr//actionscomments]}" - Thread t@807648 java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160) at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84) at org.apache.http.impl.io.SocketInputBuffer.isDataAvailable(SocketInputBuffer.java:95) at org.apache.http.impl.AbstractHttpClientConnection.isStale(AbstractHttpClientConnection.java:310) at org.apache.http.impl.conn.ManagedClientConnectionImpl.isStale(ManagedClientConnectionImpl.java:158) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:433) at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:466) at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:235) at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:227) at org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:376) at org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:328) at org.apache.solr.handler.component.HttpShardHandlerFactory.makeLoadBalancedRequest(HttpShardHandlerFactory.java:246) at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:221) at org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:183) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:148) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

锁定的可拥有同步器:
-锁定(一个java .util.concurrent.ThreadPoolExecutor $ Worker)

Locked ownable synchronizers: - locked (a java.util.concurrent.ThreadPoolExecutor$Worker)


推荐答案

使用 visualvm 来标识消耗CPU的线程。可以在DZone上找到有关解释线程转储的好文章: how-analyze-java -thread-dumps

Use visualvm to identify the thread consuming the CPU. A good article about interpreting the thread dump can be found on DZone: how-analyze-java-thread-dumps.

这应该可以让您识别线程,也许您已经可以直接识别问题本身。

This should be allow you to identify the thread and maybe you can already direct identify the problem itself.

这篇关于解决Windows Server上的高CPU使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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