嗨,我有一个应用程序,它有时会响应请求,但有时不会在给定端口上收到请求。随着流量的增加,这似乎是一个容量问题。现在我不知道是什么在扼流圈,因为它们需要调整很多参数,所以我决定从 jstack 中查看线程转储。
输出不是很有帮助,因为它只显示了几个处于 TIMED_WAIT 状态的线程,但是堆栈跟踪不够长,无法显示我的代码的哪一部分触发了这个问题。
“pool-135-thread-1”prio=10 tid=0x00000000427a8800 nid=0x7833 等待条件 [0x00007fd2b22a3000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - 停车在 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ 等待 <0x00000006a25a5458> (一个 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609) at java.util .concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue。take(ScheduledThreadPoolExecutor.java:602) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread .run(Thread.java:662)
锁定的可拥有同步器: - 无
“pool-134-thread-1”prio=10 tid=0x000000004169d800 nid=0x7832 等待条件 [0x00007fd2b23a4000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - 停车在 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196) 在 java.util.concurrent.locks.AbstractQueuedSynchronizer$ 处等待 <0x00000006a2524030> (一个 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609) at java.util .concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue。take(ScheduledThreadPoolExecutor.java:602) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread .run(Thread.java:662)
锁定的可拥有同步器: - 无
“pool-133-thread-1”prio=10 tid=0x000000004169c800 nid=0x7831 等待条件 [0x00007fd2b24a5000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - 停车在 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196) 在 java.util.concurrent.locks.AbstractQueuedSynchronizer$ 处等待 <0x00000006a25045d8> (一个 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) at java.util.concurrent.DelayQueue.take(DelayQueue.java:164) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609) at java.util .concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue。take(ScheduledThreadPoolExecutor.java:602) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread .run(Thread.java:662)
锁定的可拥有同步器: - 无
它甚至似乎都没有在等待相同的资源。
任何帮助将不胜感激。