WebLogic_Server_故障诊断_第1页
WebLogic_Server_故障诊断_第2页
WebLogic_Server_故障诊断_第3页
WebLogic_Server_故障诊断_第4页
WebLogic_Server_故障诊断_第5页
已阅读5页,还剩30页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、WebLogic Server 故障诊断故障诊断马平马平 ()高级解决方案顾问高级解决方案顾问甲骨文甲骨文 开发者计划开发者计划甲骨文融合中间件甲骨文融合中间件议程议程 故障诊断的模式故障诊断的模式 Thread Dump WebLogic Server 工作线程工作线程 典型问题及解决方案典型问题及解决方案 Server Crash Server Hang High CPU故障诊断的模式故障诊断的模式 准确描述现象:平台、版本、操作、信息 使用工具收集数据 使用工具分析数据 尝试解决问题 给出最佳解决方案 总结经验并加以重用议程议程 故障诊断的模式故障诊断的模式 Thread Dump We

2、bLogic Server 工作线程工作线程 典型问题及解决方案典型问题及解决方案 Server Crash Server Hang High CPUThread Dump JVM中所有活动线程的快照。 一个可读的文本。获取获取Thread Dump 在 Unix 平台上 kill -3 在 Windows 平台上 设置DOS 窗口的属性:Layout - Screen Buffer Size- Height 9999。 同时按下CTRL-BREAK 找到Thread Dump的最开始的位置:Full thread dump. 对于WebLoigc Server,还可使用weblogic.Ad

3、min THREAD_DUMP前提条件:服务器可以Ping通。获取失败时刻的获取失败时刻的Thread Dump 启动 JVM 时,加入参数: Sun JVM: -XX:+ShowMessageBoxOnError JRockit JVM: -Djrockit.waitonerror 当JVM崩溃时,会弹出窗口: Do you want to debug the problem? 不要选择Yes/No,获取此时的Thread Dump。Thread Dump: JDK1.5 Thread t41: (state = BLOCKED) - java.lang.Object.wait(long)

4、(Interpreted frame) - java.lang.Object.wait(long) (Interpreted frame) - java.lang.Object.wait() bci=2, line=474 (Interpreted frame) - org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run() bci=19, line=642 (Interpreted frame) - java.lang.Thread.run() bci=11, line=595 (Interpreted frame)Thre

5、ad Dump: JDK1.5UNINTIALIZEDThread is not created. This will normally not happen (unless there is aserious bug such as memory corruption).NEWThread has been created but it has not started running yet.IN_NATIVEThread is running native code.IN_VMThread is running VM code.IN_JAVAThread is running (eithe

6、r interpreted or compiled) Java code.BLOCKEDThread is blocked._TRANSIf you see any of the above states but followed by _TRANS, it means the thread is changing to a different state.议程议程 故障诊断的模式故障诊断的模式 Thread Core Dump WebLogic Server 工作线程工作线程 典型问题及解决方案典型问题及解决方案 Server Crash Server Hang High CPU工作线程工作

7、线程 两个线程池 Socket Reader 线程池 Execute 线程池Listen 线程线程 所有的请求都要由该线程放入请求队列中。 如果该线程“丢失” ,将没有任何“工作”可做。 该线程应该始终处在 socketAccept方法中。Socket Reader 线程线程 从请求队列中获取请求,并将请求放入执行队列中。 默认情况下,有5个socket reader线程(Exceute线程个数的33% ) 其中一个执行 poll功能。 其它的处理请求。Socket Reader Thread DumpExecute 线程线程 并行处理执行队列中的请求。 默认情况下,有15个Exceute线程

8、。议程议程 故障诊断的模式故障诊断的模式 Thread Dump WebLogic Server 工作线程工作线程 典型问题及解决方案典型问题及解决方案 Server Crash Server Hang High CPUServer Crash 现象描述现象描述 Server 进程崩溃,产生server core文件。 server core文件是 JVM 崩溃时的进程快照。 在Unix平台上,server core文件位于启动Server进程的目录中。 在Windows平台上,server core文件位于WindowsDrwatson目录中:Watsonxxx.wlg。引起引起Server

9、 Crash的原因的原因 Java代码只能导致Java 异常,不会导致Server Crash。 Native code:C 或 C+,是导致Server Crash的元凶。 Native code 存在于: WebLogic Server native performance packs Type 2 JDBC drivers 通过Java Native Interface (JNI) 调用的native libraries JVM 自身Server Crash故障排查故障排查 1.WLS Native Performance Packs Performance packs Use a na

10、tive socket multiplexer to improve server performance Are generally enabled by default Can be disabled via the admin console or on the WebLogic Server start command Disable the performance packs by setting NativeIOEnabled to false in order to verify whether this is the cause of the server core dump.

11、 Disabling the performance packs can impact the servers performance.Server Crash故障排查故障排查 2.Type 2 JDBC Drivers Type 2 drivers convert standard JDBC (Java) method calls into native database API calls. Switch to an all-Java (type 4) driver to verify this is the cause of the server core dump. If substi

12、tution is not possible, logging and debugging may identify why failures occur.Server Crash故障排查故障排查 3. Java Native Interface (JNI) Calls Java programs use JNI to operate with native language applications and libraries, for example, C, C+ or assembler. It is difficult to substitute or eliminate these

13、libraries in order to verify that this is the cause of the server core dump. Additional logging and debugging may be required to determine the conditions in which the failures occur. The problem may be due to: Incorrect use of the JNI interface The JNI libraries The underlying native codeServer Cras

14、h故障排查故障排查 4.The Java Virtual Machine The JVM is a Java code interpreter that translates Java code into native platform operations. Substitute a different JVM or a later release to verify that this is the cause of the server core dump. Just In Time (JIT) compiler: Many JVM bugs involve the use of a J

15、IT compiler To disable this feature, use: -Dpiler=none on the server startup command.JVM 日志文件日志文件 Server Crash时,JVM可能会产生一个日志文件。 JVM日志文件: 位于启动Server进程的目录中 名称类似于 hs_err_pid.log议程议程 故障诊断的模式故障诊断的模式 WebLogic Server 工作线程工作线程 典型问题及解决方案典型问题及解决方案 Server Crash Server Hang High CPUServer Hang 现象描述现象描述 响应时间越来越长

16、。 请求没有得到响应。 资源濒临枯竭:内存、工作线程、数据库连接池引起引起Server Hang的原因的原因 工作线程太少 垃圾回收占用时间太多 JVM代码优化问题 应用程序死锁 JDBC 死锁 Remote JNDI lookups JSP 编译 JSP 不正确的设置:PageCheckSeconds JVM bugServer Hang故障排查故障排查 Ping Serverjava weblogic.Admin -url t3:/localhost:7001 -username -password PING如果服务器有响应,说明是应用本身挂起了,服务器并没有挂起。 检查垃圾回收:verb

17、osegc检查挂起时,是否正在进行频繁的垃圾回收。 查看工作线程:Listener、Socket Reader、Execute是否Listener/ Socket Reader 线程存在,并正常工作?是否Execute线程都处在忙碌状态? 查看Thread Core Dump每个线程都在忙些啥?进一步观察分析进一步观察分析 1.挂起时仍有空闲的挂起时仍有空闲的Execute 线程线程 确定Socket Reader 线程都在正常工作。 适当提高 Socket Reader 线程数。 集群环境下需要更多的Socket Reader 线程。进一步观察分析进一步观察分析 2.挂起时没有空闲的挂起时没

18、有空闲的Execute 线程线程 确定所有线程都在正常工作,没有死锁等现象。 为耗时较长的请求创建单独的请求队列。 增加资源:内存、工作线程、数据库连接池 应用检查 EJB RMI calls JSP calls 其它检查 Garbage collection Code optimization JVM bugs JSP compilationJDBC Connection Pool Resources When a JDBC connection pool becomes depleted: The server may hang waiting for a resources. The thread du

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论