Java企业应用-性能优化原则, 方法与策略.pptx
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《Java企业应用-性能优化原则, 方法与策略.pptx》由用户(无敌的果实)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Java企业应用-性能优化原则 方法与策略 Java 企业 应用 性能 优化 原则 方法 策略
- 资源描述:
-
1、Java企业应用-性能优化原则,方法与策略Outline1.Performance Basics and Methodology2.Fundamentals of Performance Tuning Profiling Driven Optimization JVM Tuning GC JIT3.Optimization Strategy for JavaEE4.RecapRecall Littles lawL=*WIn queueing theory,the long-term average number ofcustomers in a stable system,L,is equal
2、 to the long-termaverage arrival rate,multiplied by the average time acustomer spends in the system,Wsource:https:/en.wikipedia.org/wiki/Little%27s_lawThroughput and RTMeanNumberInSystem=MeanThroughput*MeanResponseTime.Throughput and RT are related Decreasing RT”almost always”improves Throughput Thr
3、oughput improving doesnt necessarily mean RTdecreasing.Performance tuning and cost saving More higher throughput/lower RT but without addingnew hardwaresource:https:/en.wikipedia.org/wiki/Little%27s_lawApproaches to PerformanceApp Algorithm optimization Profiling-drivenAppServerJava VM Upgrade(JDK&O
4、S)JVM(OS)Tuning SpecializationOperating SystemHardware Use new hardware Use cheaper hardwareJavas viewApproaches:a)Outside in approach(performance baseline)b)Layered approach(“Bottom up”or“Top down”)c)A hybrid of both a),b)Amdahls Scaling Law1Speedup=1+F:is fraction of workthat is serialN:is number
5、ofthreadssource:https:/en.wikipedia.org/wiki/Amdahl%27s_law Reduce the amount of serial work performedCosts Reduce Scaling1.Potential contributors to F:.Synchronization(synchronized&j.u.c.Lock)data structures need to be thread.JConsole(MXBean).Java Mission Control.JProfilersafe communication overhea
6、d between.HealthCenter&jucProfilerthreads.Infamous“stop the world”(aka STW)inJVM2.Cost incurred when the N gets increased.Thread context switchProfiling:Sampling vs Instrumentsamplingmethod callbarfoobarfoomainmainInstrumentbarfoomainAvailable Technology:BCI,JVMTi,javax.management,System.currentTime
7、Millis()Sampling vs Instrument.Sampling Lower overhead(determined by sampling interval)Discover unknown code Non intrusive No execution path Periodicity Bias.Instrument Wall time(estimate IO time)Full execution path Configuration on what methods to instrument Generally more data to be collectedSafep
8、oint Bias.Stack trace sampling happens only when thegiven thread at a safepoint The hot loop may not get profiled anymore.Use following tools instead Java Mission Control Honest Profiler(githup)ZProfiler(alipay internal profiling tool)Tools for Diagnostics Most of them could be found in JAVA_HOEM/bi
展开阅读全文