监控指标<wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">性能测试通常需要监控的指标包括:</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">1.服务器</span><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3ELinux%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">Linux<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">(包括CPU、Memory、Load、I/O)。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">2.数据库:1.Mysql 2.Oracle(缓存命中、索引、单条SQL性能、</span><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3E%CA%FD%BE%DD%BF%E2%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">数据库<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">[/url]线程数、数据池连接数)。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">3.中间件:1.Jboss 2. Apache(包括线程数、连接数、</span><a href="http://user.qzone.qq.com/783861658/blog/%C8%D5%D6%BE%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">日志<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">)。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">4.网络: 吞吐量、吞吐率。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">5.应用: jvm内存、日志、Full GC频率。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">6.监控</span><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3E%B9%A4%BE%DF%3C/font%3E%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">工具<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">(</span><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3ELoadRunner%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">LoadRunner<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">[/url]):用户执行情况、场景状态、事务响应时间、TPS等。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">7.测试机资源:CPU、Memory、网络、磁盘空间。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><strong><wbr>监控工具</wbr></strong><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">性能测试通常采用下列工具进行监控:</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">1.Profiler。一个记录log的类,</span><a href="http://user.qzone.qq.com/783861658/blog/%B0%A2%C0%EF%B0%CD%B0%CD%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">阿里巴巴<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">集团自主</span><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3E%BF%AA%B7%A2%3C/font%3E%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">开发<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">,嵌入到</span><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3E%D3%A6%D3%C3%3C/font%3E%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">应用<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3E%B4%FA%C2%EB%3C/font%3E%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">代码<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">中使用。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">2.Jstat。监控</span><a href="http://user.qzone.qq.com/783861658/blog/%3Cfont%3Ejava%5B/B%5D%5B/U%5D" target="_blank" style="color:rgb(37,149,183); margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; text-decoration:none; font-family:Tahoma; font-size:14px; line-height:22px">java<wbr><wbr></wbr></wbr></a><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">[/url]进程GC情况,判断GC是否正常。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">3.JConsole。监控java内存、java CPU使用率、线程执行情况等,需要在JVM参数中进行配置。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">4.JMap。监控java程序是否有内存泄漏,需要配合eclipse插件或者MemoryAnalyzer来使用。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">5.JProfiler。全面监控每个节点的CPU使用率、内存使用率、响应时间累计值、线程执行情况等,需要在JVM参数中进行配置。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">6.Nmon。全面监控linux系统资源使用情况,包括CPU、内存、I/O等,可独立于应用监控。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">7.Valgrind。监控C/C++程序是否存在内存泄漏,基于linux环境。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">8.Vmmap和ApplicationVerifier。监控C/C++程序是否存在内存泄漏,基于windows环境。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><strong><wbr>性能分析</wbr></strong><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">可按以下顺序:</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">中间件瓶颈(apache/jboss参数配置、数据库参数配置)-></span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">应用服务的debug log -></span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">应用服务的filter log -></span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">本应用的性能瓶颈(SQL语句、索引、业务逻辑、线程池设置、算法)-></span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">服务提供者的性能瓶颈 -></span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">相关联的底层存储应用的性能瓶颈</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><strong><wbr>分析标准</wbr></strong><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">通过性能指标的表现形式,分析性能是否稳定。比如:</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">1.响应时间是否符合性能预期,表现是否稳定。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">2.应用日志中,超时的概率,是否在可接受的范围之内。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">3.TPS维持在多大的范围内,是否有波形出现,标准差有多少,是否符合预期。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">4.服务器CPU、内存、load是否在合理的范围内,等等。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><strong><wbr>分析工具</wbr></strong><wbr style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">对于部分性能指标,可借助自动分析工具,统计出数据的总体趋势:</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">1.LoadRunner analysis</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">LoadRunner analysis是loadrunner的一个部件,用于将运行过程中所采集到的数据生成报表,主要用于采集TPS、响应时间、服务器资源使用情况等变化趋势。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">2.Memory Analyzer</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">Memory Analyzer工具可以解析Jmap dump出来的内存信息,查找是否有内存泄漏。</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">3.nmon_analyser</span><br style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px">nmon工具可以采集服务器的资源信息。列出CPU、MEM、网络、I/O等资源指标的使用情况。</span><span style="color:rgb(84,84,84); font-family:Tahoma; font-size:14px; line-height:22px"></span> </wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>