我们在tomcat节点中看到了一些奇怪的问题。我花了线程转储来查看线程状态。在大多数线程处于IN_NATIVE状态。有人能告诉我这是什么以及是什么造成的?这是线程的堆栈跟踪。很多线程处于IN_NATIVE状态
Thread 677: (state = IN_NATIVE)
- java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Compiled frame; information may be imprecise)
- java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129 (Compiled frame)
- com.sun.net.ssl.internal.ssl.InputRecord.readFully(java.io.InputStream, byte[], int, int) @bci=21, line=293 (Compiled frame)
- com.sun.net.ssl.internal.ssl.InputRecord.read(java.io.InputStream, java.io.OutputStream) @bci=32, line=331 (Compiled frame)
- com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(com.sun.net.ssl.internal.ssl.InputRecord, boolean) @bci=44, line=789 (Compiled frame)
- com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(com.sun.net.ssl.internal.ssl.InputRecord) @bci=15, line=746 (Compiled frame)
- com.sun.net.ssl.internal.ssl.AppInputStream.read(byte[], int, int) @bci=30, line=75 (Compiled frame)
- java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled frame)
- java.io.BufferedInputStream.read1(byte[], int, int) @bci=44, line=258 (Compiled frame)
- java.io.BufferedInputStream.read(byte[], int, int) @bci=49, line=317 (Compiled frame)
- com.sun.jndi.ldap.Connection.run() @bci=30, line=808 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)
Thread 675: (state = IN_NATIVE)
- java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Compiled frame; information may be imprecise)
- java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129 (Compiled frame)
- com.sun.net.ssl.internal.ssl.InputRecord.readFully(java.io.InputStream, byte[], int, int) @bci=21, line=293 (Compiled frame)
- com.sun.net.ssl.internal.ssl.InputRecord.read(java.io.InputStream, java.io.OutputStream) @bci=32, line=331 (Compiled frame)
- com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(com.sun.net.ssl.internal.ssl.InputRecord, boolean) @bci=44, line=789 (Compiled frame)
- com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(com.sun.net.ssl.internal.ssl.InputRecord) @bci=15, line=746 (Compiled frame)
- com.sun.net.ssl.internal.ssl.AppInputStream.read(byte[], int, int) @bci=30, line=75 (Compiled frame)
- java.io.BufferedInputStream.fill() @bci=175, line=218 (Compiled frame)
- java.io.BufferedInputStream.read1(byte[], int, int) @bci=44, line=258 (Compiled frame)
- java.io.BufferedInputStream.read(byte[], int, int) @bci=49, line=317 (Compiled frame)
- com.sun.jndi.ldap.Connection.run() @bci=30, line=808 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=619 (Interpreted frame)
全部Threaddump是@ https://docs.google.com/document/d/16YnK85jrlxvu_PpQrTQxtIWjWmAlt8AF1ddAOzvisCM/edit?usp=sharing
线程被阻塞用于输入数据,可能正在等待来自mysql服务器的数据。如果没有数据被等待,那么你已经陷入了mysql服务器的bug。检查'show processlist'以查看是否有查询正在执行,如果不是 - 这是bug:http://bugs.mysql.com/bug.php?id=24995 – bestsss
@bestsss与MySQL无关。查看堆栈跟踪。 – EJP
看起来像mysql导致这一点,但我不知道,因为我看到一堆缓慢的查询在同一时间约20至30秒的日志。我仍然无法找到原因。帮助赞赏。提前致谢。 – Chandu