gpt4 book ai didi

java - 许多线程正在等待条件并且服务器负载超过100

转载 作者:太空宇宙 更新时间:2023-11-04 09:42:59 27 4
gpt4 key购买 nike

Tomcat 中处于 WAITING 状态的线程过多。50% 线程处于等待状态

Tomcat 7。CPU核心16.CPU 占82%。内存够用,16g可用空间。半小时只有1次fullgc。Linux 系统负载有时为 50+、50+、50+,甚至 100+。我的代码中从来没有 ExecutorService 或 ThreadPool。

"catalina-exec-682" daemon prio=10 tid=0x00007f530442e800 nid=0x16f8 waiting on condition [0x00007f51b9a3a000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000073168d480> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Locked ownable synchronizers: - None

"catalina-exec-681" daemon prio=10 tid=0x00007f530442c800 nid=0x16f7 waiting on condition [0x00007f51b9a7b000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000073168d480> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Locked ownable synchronizers: - None

我预计没有线程状态正在等待条件,所有这些线程都是由tomcat创建的,但50%正在等待条件。

最佳答案

好吧,也许是因为当你检查时他们无事可做 - 马丁·詹姆斯

这似乎是 tomcat 线程池。如果不被使用,它们就不会做任何事情。您应该能够将池大小设置为较小的值,但我不认为这会产生影响。 – 彼得·劳瑞

感谢您的回答,一切都很好,没有任何问题。

关于java - 许多线程正在等待条件并且服务器负载超过100,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55755898/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com