• 1. 1 WebLogic Server 性能监控与调优Overview-1
  • 2. WebLogic的版本WebLogic Server 8.1 (Java 1.4、J2EE 1.3) WebLogic Server 9.x (Java 5、J2EE 1.4) WebLogic Server 10.0 (Java 5、Java EE 5) WebLogic Server 10.3 (Java 6、Java EE 5) WebLogic Server 11gR1(10.3.x) (Java 6、Java EE 5) 软件授权:自从oracle收购了bea之后,WebLogic的序列号全都开放了,没有必要再去进行破解了。2
  • 3. WebLogic 主要使用 的JVMSUN HotSpot JVM BEA JRockit JVM 不同的JVM,其可设置的参数和监控的工具将是不同,后面将分别介绍这两种JVM的设置。 在Intel架构和windows平台上,建议使用JRockit JVM,这样可以带来更优的性能。3
  • 4. WebLogic实例主要设置内容启动参数设置 主要是设置GC参数 线程设置 主要是设置线程的数量 数据库连接池的设置 主要是设置连接池的初始容量和最大容量 4
  • 5. WebLogic 8.1 启动文件%DOMAIN_HOME%/startWebLogic.cmd 设置实例的运行模式:开发模式/生产模式 设置JAVA_HOME 设置JAVA_VM:client/server/jrockit 设置MEM_ARGS %WL_HOME%\common\bin\commEnv.cmd 设置所有实例都统一使用的参数5
  • 6. WebLogic 9.2 启动文件%WL_HOME%\common\bin\commEnv.cmd 设置所有实例统一的运行参数 %DOMAIN_HOME%\bin\setDomainEnv.cmd 设置本实例的运行参数 %DOMAIN_HOME%\bin\startWebLogic.cmd 运行启动脚本6
  • 7. 7 Sun HotSpot Heap 分布Heap is divided broadly into three areas: Young (New) generation Tenured (Old) generation Permanent (Perm) generation Young generation is further divided into: Eden Survivor spaces(2) Xmx
  • 8. 8 Tuning GC Manually…New self-tuning feature is not available while tuning JVMs prior to version 1.5 and manual tuning is required. The following are the common tuning parameters available while tuning the garbage collection manually: Size of the the overall heap -Xms[n] -Xmx[n] Size of the generations in the heap -XX:NewSize=n -XX:MaxNewSize=n -XX:NewRatio=n
  • 9. 9 …Tuning GC ManuallyCommon tuning parameters (continued) The size of the survivor spaces in the young generation -XX:SurvivorRatio=n The size of the permanent generation -XX:PermSize=n -XX:MaxPermSize=n The threshold for promotion from the young generation to the old generation -XX:MaxTenuringThreshold=n Tuning involves either a series of experiments with a specialized tool (or) good judgment to decide that GC was performing well.Tuning Sun HotSpot JVM-38
  • 10. 10 JRockit BenefitsWeblogic JRockit JVM is designed for server-side applications. It employs adaptive optimization to significantly improve runtime performance. It has adaptive garbage collection and heap management. It offers full support for 32 and 64 bit JRockit on Intel EM64T/AMD64 and compatibles. JRockit also supports Solaris/Sparc architecture. It offers support for very large heaps on 64 bit platforms. JRockit Mission Control tools suite offers better management, tuning and troubleshooting.
  • 11. 11 Generational Heap - JRockitIn the two-generational model, heap is divided into two generations Young generation (Nursery) Old generation In a single-spaced model, all the objects are allocated in a single space on the heap. NurseryOld SpaceXnsXmxXmx
  • 12. WebLogic 8.1 实例的线程设置...线程的设置主要是在weblogic控制台中完成12
  • 13. .WebLogic 8.1 实例的线程设置..13
  • 14. ..WebLogic 8.1 实例的线程设置.14
  • 15. …WebLogic 8.1 实例的线程设置15
  • 16. WebLogic 9.2 实例的线程设置.线程管理与WebLogic 8.1存在很大的不同,由WebLogic自动去管理。 默认情况下,WebLogic提供的线程数量较小,并且在管理控制台上没有修改线程数量的链接。16
  • 17. .WebLogic 9.2 实例的线程设置可以通过手动修改config.xml文件,使用与weblogic 8.1相同的线程设置风格。 主要是在中添加以下代码:17
  • 18. 数据连接池、数据源的主要配置连接池的初始容量、最大容量、增长容量。 是否启用连接泄露配置。 是否测试数据库连接。 数据库连接的时间设置。18
  • 19. Oracle RAC 集群Oracle RAC(Oracle Real Application Cluster),Oracle数据库的集群。 基于共享存储的数据库,具有多个数据库运行实例。 tnsnames.ora形式与常规模式不同。19
  • 20. Oracle RAC的数据源配置url 采用oracle tnsname配置的方式: 配置WebLogic多池数据源方式: Multipool(WebLogic 8.1) 多数据源(WebLogic 9.2)20
  • 21. Sun HotSpot-JConsole21 JConsole is a JMX-compliant GUI tool that connects to a running JVM, which is started with the management agent. JDK 5.0 includes the monitoring and management tool, JConsole. JConsole allows you to see inside the JVM and the application while it's running. JConsole provides real time viewing of the performance of applications and shows their resource consumption.
  • 22. 22 …JConsole…The management agent in the JVM should be started for monitoring. It can only connect to one JVM at any time. To use JConsole for connecting to a JVM locally, WebLogic Server should be started with the option to enable the management agent. -Dcom.sun.management.jmxremote
  • 23. 23 Jconsole Remote MonitoringTo enable the JMX agent (JConsole) for remote access, set this system property when you start WebLogic Server or JVM : Dcom.sun.management.jmxremote.port=portNo Connecting remotely through JConsole is the recommended way when monitoring or managing production environments.Tuning Sun HotSpot JVM-12
  • 24. SUN HotSpot-jvisualvmJava 6 里自带的一个监控jvm运行状况的工具。 %JAVA_HOME%/bin/jvisualvm.exe24
  • 25. Oracle JRockit Mission ControlWindows平台下,性能较优的JVM。 提供的很好的监控工具,用于监控WebLogic的运行状况。 针对不同的JDK 版本,都有对应的安装程序。 可以从Oracle网站免费下载 http://www.oracle.com/technetwork/middleware/jrockit/overview/index.html25
  • 26. 26 BEA JRockit Mission ControlBEA JRockit ships with BEA JRockit Mission Control. These are a group of independent management and monitoring tools. BEA JRockit Management Console JMX Complaint monitoring tool BEA JRockit Runtime Analyzer Records and helps you analyze JVM and running application BEA JRockit Memory Leak Detector Detects and finds the cause for memory leaks The main focus of JRockit Mission Control is to do the necessary instrumentation with the lowest possible impact on the system.
  • 27. 27 Management ServerThe management server in the JRockit VM is disabled by default. To enable the management server, add the following command-line argument to the JVM start script: java -Xmanagement … weblogic.Server The default port that the management server uses to connect is 7091. You can change the management server port by setting the following command-line argument: -Djrockit.managementserver.port=
  • 28. 网页数据分析工具-HttpWatchHttpWatch是强大的网页数据分析工具。 集成在Internet Explorer工具栏。 网页摘要。 Cookies管理。 缓存管理。 消息头发送/接受。 字符查询。 POST 数据。 报告输出。 28