版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、WLS Performance Tuning,Jerry Hu J,内容,性能调优概述 Oracle 高性能产品及技术简介 操作系统调优 网络调优 JVM 调优 WebLogic Server调优,一个Web系统的性能是由多种因素决定的,性能优化的准则,性能调整并不是万全之策 简而言之,高系统性能取决于:良好的设计、良好的实现、明确的性能目标和性能调整。 性能调整是一个持续不断的过程。 其目的在于达到性能目标,而不是消除所有瓶颈。系统中的资源有限。根据定义,系统中至少有一种资源(CPU、内存或 I/O)是瓶颈。通过调整可将瓶颈对性能目标的影响降到最低程度。 设计应用程序时要考虑到性能: 保持设
2、计的简单性 避免不当使用已发布模式。 应用 Java EE 性能模式。 优化 Java 代码。,衡量的标准及关注点,系统响应时间 TPS 扩展性 其他,内容,性能调优概述 Oracle 高性能产品及技术简介 操作系统调优 网络调优 JVM 调优 WebLogic Server调优,Network,Oracle 全面满足客户的高性能需求,Web Cache,Web Servers,Application Servers,Coherence,RAC,Times Ten,HTML Data Structures in Memory,Java Data Structures in Memory,SQL
3、 Data Structures in Memory,Web Cache offloads Web Servers, Improves Network Performance via Compression,Coherence caches Java Structures in Memory; Very Fast Access to Java Data in Memory across Mid-Tier Grid,Times Ten & RAC provide Scalability to Database Data improving Query & Transaction Write Pe
4、rformance,Web Tier,Application Tier,Database Tier,TimesTen: 针对物理内存而特别设计优化的数据库,所有数据存于物理内存 采用关系型数据模型 针对物理内存而特别设计优化的数据存储结构与算法 多进程/多线程共享数据存储(Data Store) 嵌入式 或 客户机-服务器式 标准 APIs (ODBC, JDBC, SQL-92) 易于安装与配置,Application-Tier Platform,Network,In-MemoryDatabase(s),Transaction Logs,.,Client-Server,Checkpoint
5、files,内存数据库与磁盘数据库的比较,内存数据网格Coherence,提供单一、可靠、一致的数据层 提供同台的数据保存能力,包括容错和负载均衡 保证了数据容量按照处理能力线性升级 在不同应用,同一个应用的不同模块之间方便的共享数据,Mainframes,Databases,Web Services,Enterprise Applications,Real Time Clients,Web Services,Application Tier,Coherence Data Grid,Data Sources,Data Services,内存数据网格Coherence,Caching,Analy
6、tics,Transactions,Events,可靠的内存数据网格服务,基于Oracle Coherence的分布式内存数据网格,Oracle Coherence 客户程序 数据访问, 分析, 交易, 事件,内容,性能调优概述 Oracle 高性能产品及技术简介 操作系统调优 网络调优 JVM 调优 WebLogic Server调优,操作系统调优,每种操作系统缺少的优化参数是不同的。在Windows平台,缺省的设置通常就足够了,在UNIX和Linux通常需要进行适当的调整 UNIX和Linux通常需要调整以下一些参数设置 Swap空间 Process and threads Tcp par
7、ameters File Descriptor 在调优测试时,应使用系统监控工具来收集资源利用的情况,如cpu利用率,磁盘I/O,网络效率等,文件描述符,操作系统把TCP套接字当做一种特殊的文件存取格式来处理,并使用文件描述符来跟踪记录操作系统进程打开的套接字和文件。为了控制资源的使用情况,操作系统会限制每个进程打开的文件描述符的数量 默认情况下,一个进程可获得的文件描述符的数量取决于操作系统的类型及它的配置情况,Time wait interval,应用程序关闭的TCP连接在被操作系统释放前,将先进入等待状态。套接字处于等待状态的时间称为time wait interval。在这种状态下,操
8、作系统会维护分配给该socket的资源,包括文件描述符 This parameter determines the time interval that a TCP socket is kept alive after issuing a close call,swap空间,太多的Swap空间会浪费磁盘空间,而太少的Swap空间,则系统会发生错误,如果Swap空间用完,则服务进程无法启动,通常会出现“application is out of memory”的错误,严重时会造成服务进程的死锁。 Swap分区的数量对性能也有很大的影响,操作系统调优参考, (solaris8) (solaris9
9、) (AIX) (HP-UX) http:/ipsysctl- (Linux) (Windows),内容,性能调优概述 Oracle 高性能产品及技术简介 操作系统调优 网络调优 JVM 调优 WebLogic Server调优,带宽,带宽指的是传输系统能够响应的信号的最高频率,因此它反映了传输系统的容量 网络调优应监控几个关键的网络统计值(数据包再发送,重复数据包,数据包监听丢失)以监控网络性能,解决性能问题时,不要忘记检查数据包丢失或错误 应该确保应用系统有足够的带宽,如客户端到WebLogic Server, WebLogic Server,到数据库服务器之间的带宽,在一机器上运行的We
10、bLogic Server,必须要有充足的带宽来处理维护所有WebLogic Server,客户端的连接。 在集群中,Servlets和EJBs复制session信息需要更大的网络带宽 使用压缩,如gzip,LAN Infrastructure,LAN必须有足够的处理应用高峰的能力。如果网络流量经常大于网络资源的承载能力,则需要: 重新设计网络和重新分配负载 减少客户端数量 提高系统对网络负载的处理能力,网络监控与调优,网络调优应监控几个关键的网络统计值(数据包再发送,重复数据包,数据包监听丢失)以监控网络性能,解决性能问题时,不要忘记检查数据包丢失或错误 netstat (显示协议统计和当前
11、的 TCP/IP 网络连接 ) netstat -a -e -n -s -p protocol -r interval,内容,性能调优概述 Oracle 高性能产品及技术简介 操作系统调优 网络调优 JVM 调优 WebLogic Server调优,JVM,JVM vendor and version,推荐使用经过WLS认证的JVMs 在IA架构的系统上应考虑使用Jrockit,JRockit Benefits,Weblogic JRockit JVM is designed for server-side applications. It employs adaptive optimizat
12、ion 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 platform
13、s. JRockit Mission Control tools suite offers better management, tuning and troubleshooting.,BEA JRockit Mission Control -Architecture,JRockit Management Console,GC,影响 GC 的几点 对象创建的频率 对象的Life Spans Type of Objects Relations between Objects 不要使用 System.gc(),因为这是个 Full GC,中断时间会比较长,效率低。也不要使用 finalize()
14、方法。 Object 不需要时,显示的将其赋值为 null 多用 Pool,但是小的 Object 不要使用 pool,因为会带来 GC 的效率问题,手工进行GC,thread Dumps,thread dumps记录了current stack trace, state, and name of the threads 。 调用的堆栈包含完整的类名,所执行的方法,如果可能的话还有源代码的行数。 可以使用thread dumps来分析应用的挂起、退出和响应时间较差的情况,Thread dump,确定执行线程在每次dump都有进展 特别注意以下MW状态的线程 I/O,call DB Loop B
15、acks 连接外部的servers 执行线程同步造成的死锁 检测WLS 线程死锁 从 正确等待锁的线程开始 找到目前锁的拥有者,推断Blocked原因,JVM调优参考,Tuning Garbage Collection with the 1.4.2 Java Virtual Machine Java HotSpot VM Options Big Heaps and Intimate Shared Memory Performance Documentation for the Java HotSpot VM Analyzing Java Application Problems,内容,性能调优
16、概述 Oracle 高性能产品及技术简介 操作系统调优 网络调优 JVM 调优 WebLogic Server调优,Tuning WebLogic Server - Native IO,WLS为一些平台提供性能包,这些性能包更紧密地结合平台的I/O操作提高了应用程序性能,激活本地的I/O性能包将产生很大的性能提高,Tuning WebLogic Server - AcceptBacklog,WLS使用AcceptBacklog参数规定WLS向操作系统请求的队列的大小, AcceptBacklog属性决 定了在等待队列(监听队列)中最多可以有多少TCP连接等待处理,默认值为50 如果在许多客户端
17、连接被拒绝,而在服务器端没有错误显示,说明该值设得过低 如果连接时收到了”connection refused”消息,可以适当增大weblogic.system.acceptBacklog的值,每次增加25,Tuning WebLogic Server - Timeout,Login Timeout The login timeout (between 0 and 100000 milliseconds) for this servers default regular (non-SSL) listen port. This is the maximum amount of time allo
18、wed for a new connection to establish. A value of 0 indicates there is no maximum. SSL Login Timeout The login timeout (between 0 and 100000 milliseconds) for this servers default SSL listen port. This is the maximum amount of time allowed for a new connection to establish. A value of 0 indicates th
19、ere is no maximum.,Tuning WebLogic Server - Keep-Alive,Keep-Alive是Http1.1的一个重要特性,Web Server可以在一个给定的时间周期内,对于一个客户机的所有请求只需打开一个套接字,Tuning WebLogic Server - Web Container,Synchronization Uncommon, but crippling factor HTTP Session Management Isolate session data that changes frequently into a separate at
20、tribute Isolate session data that changes in tandem into same attribute,Tuning WebLogic Server - Web Container,Disable Servlet and JSP page checks Default for production mode in 9.0 jsp-param pageCheckSeconds=-1 servlet-reload-check-secs=-1 in container-descriptor ServletReloadCheckSecs=-1 in WebApp
21、Component element in config.xml For JSPs, both of these have to be set Gains of 5% to 8% have been observed JSP caching tag Support both output and input caching WLS-proprietary,Tuning WebLogic Server - EJB Container,General Use proven session-faade pattern Avoid “RequiresNew” transaction attribute
22、Use local interfaces or call-by-reference Stateless Session Beans and Message Driven Beans Max-beans-in-free-pool and Initial-beans-in-free-pool Stateful Session Beans Max-beans-in-cache large enough to handle concurrent users Avoid SFSB replication,Tuning WebLogic Server - JMS,Excellent Reference:
23、“BEA WebLogic JMS Performance Guide” WARNING: A lot of information is out-dated for 9.0 JMS Pooling Pool and/or cache JMS resources when possible: Avoid creating and closing a connection, session, producer, consumer, or temporary destination for each message Resource Pooling in EJBs and Servlets JMS
24、 Store File-store in 9.0 much faster, as in 8.1 SP4 Prefer file-stores over DB stores,Tuning WebLogic Server - JMS,Message Pipeline Pipeline of in-flight messages between a client and consumer Since 9.1, also works for synchronous consumers Tune via messages-maximum on the connection factory Interac
25、tion with max-message-size Rule of thumb: MM = 300K/avg-message-size Controlling memory usage: Paging and Quotas Messages paged onto disk to conserve memory Degrades performance when it occurs, but may be necessary Paging tuning changed drastically in 9.0, default is true Quotas limit number of mess
26、ages on destination that are pending delivery,Tuning WebLogic Server - JMS,Server-side SAF Clusterable Replaces bridging between WebLogic 9.x destinations Up to 50% faster No transactions for exactly-once persistent messaging Tune via window-interval and window-batch Coming Soon A lot of new JMS per
27、formance features and improvements in 9.x Updated JMS Performance and Tuning Guide,Tuning WebLogic Server - JDBC,Connection Pooling min-capacity = max-capacity Big overhead: ConnectionLeakProfiling, CheckConnectionOnReserve/Release, AutoJDBCConnectionClose Pool size sum of thread-counts of all execu
28、te queues expected to perform DB operations JDBC Driver Choosing the right driver important type 2 driver not necessarily faster Oracle 10g thin driver significantly faster than the 9i thin driver 8.1 has new type 4 drivers For Oracle 10g, use driver property WireProtocolMode=2,Tuning WebLogic Serve
29、r - JDBC,Prepared-statement cache Connection-specific cache of compiled SQL statements Requires use of java.sql.PreparedStatement Default is 10, should be set to total number of prepared statements in the application StatementCacheSize setting in config.xml for 8.1 and later PreparedStatementCacheSi
30、ze in config.xml for 7.0 and earlier For EJB applications, a rough calculation is no. of prepared statements (no.-of-finders + no.-of-field-groups + 3)*(no.-of-CMP Beans) Actual number could be higher,Tuning WebLogic Server - XA,XA Overhead Transaction logging Logging Last Resource (LLR) optimizatio
31、n (new in 9.0) http:/e- Use separate physical drives for transaction logs and JMS file stores Transaction Log files can use Direct-Write Inefficient XA implementation of JDBC drivers Additional DB work 2PC Requirement JDBC and JMS in a transaction Using 2 destinations from different JMS servers in a transaction,Tuning WebLogic S
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 永州师范高等专科学校《录音艺术与声音剪辑》2024-2025学年第二学期期末试卷
- 流动宴席内部管理制度
- 海尔内部奖罚制度
- 海边景区内部管理制度
- 煤矿内部用电管理制度
- 煤矿运输区内部管理制度
- 环保纠纷内部处置制度
- 甲方人员内部管理制度
- 监理内部考核投诉制度
- 科室内部审计制度
- DB11-T 1998-2022 既有公共建筑节能绿色化改造技术规程
- 大班社会数学《小学生的课间十分钟》课件
- 2024年常州工业职业技术学院单招职业技能测试题库附答案
- 中国联通通信网络运行维护规程-动力环境分册
- 娄底职业技术学院单招《语文》考试复习题库(含答案)
- 两办意见八硬措施煤矿安全生产条例宣贯学习课件
- 渠道销售方案
- 12SS508《混凝土模块式室外给水管道附属构筑物》
- “月食”抑郁症主题系列海报情感化设计研究
- 护理伦理学(高职)PPT完整全套教学课件
- 牛羊布病流行病学调查表
评论
0/150
提交评论