【性能诊断】十、性能问题综合分析(案例1,windbg、Network Monitor)

【问题描述】:

产品中某业务功能A,在进行“刷新”—>选择制单—>新增—>切换其他行等一系列操作后,突然发生客户端不响应的现象。

经反复测试验证发现,在单用户场景下也会发生,不过一旦客户端启用了Fiddler工具,此问题便无法重现。并且问题发生后,抓取应用服务器的dump文件进行分析,未发现running状态的线程。

【分析过程】:

根据问题描述初步判定原因在客户端或网络环境上,因此决定采用客户端抓取dump并同时进行网络抓包。在问题重现后,抓取客户端的dump文件,发现客户端的堆栈信息中可以看到,获取Stream后等待流完成。windbg日志如下:

0:000> !clrstack PDB symbol for clr.dll

not

loaded OS Thread Id: 0x3bf8 (0) Child SP IP

Call

Site 0030e658 77860159 [

HelperMethodFrame_1OBJ:

0030e658] System.Threading.WaitHandle.WaitOneNative(System.Runtime.InteropServices.SafeHandle, UInt32, Boolean, Boolean) 0030e73c 6f5d56b1 System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle,

Int64, Boolean, Boolean)
0030e754 6f5d5684 System.Threading.WaitHandle.WaitOne(

Int32

, Boolean)
0030e768 6ea04ef5 System.Net.LazyAsyncResult.WaitForCompletion(Boolean)
0030e798 6ea326ab System.Net.Connection.SubmitRequest(System.Net.HttpWebRequest, Boolean)
0030e7e4 6ea30948 System.Net.ServicePoint.SubmitRequest(System.Net.HttpWebRequest, System.String)
0030e820 6ea30215 System.Net.HttpWebRequest.SubmitRequest(System.Net.ServicePoint)
0030e84c 6ea567d4 System.Net.HttpWebRequest.GetRequestStream(System.Net.TransportContext ByRef)
0030e890 6ea5659e System.Net.HttpWebRequest.GetRequestStream()
0030e898 076f30c6 xxxxxx.Platform.AppFramework.RestfulClientService.HttpRequestNetConnection.Invoke(xxxxxx.Platform.AppFramework.Service.GSPState, System.String, System.String, System.String, Boolean, System.String[])
0030e90c 076f3044 xxxxxx.Platform.AppFramework.Service.InvokeService.Invoke(xxxxxx.Platform.AppFramework.Service.GSPState, System.String, System.String, System.String, Boolean, System.String[])
0030e954 1dc33a38 xxxxxx.Platform.XForm.FormWebServiceClient.FormDataAccessServiceProxy.GetObjectXmlByQueryTypeWithParameters(System.String, System.Object, Int32, System.String ByRef, xxxxxx.Platform.AppFramework.Service.GSPState)
0030e978 1dc33917 xxxxxx.Platform.XForm.FormWebServiceClient.FormDataAccessServiceClient.GetObjectXml(System.String, System.Object, xxxxxx.Platform.Engine.DataAccess.ClientSPI.DataQueryType, xxxxxx.Platform.XForm.SPI.TransferState, xxxxxx.Platform.AppFramework.Service.GSPState)
0030e9a0 1dc338c7 xxxxxx.Platform.XFormEngine.Core.ResourceFetcher.GetInstanceXml(System.String, System.Object, xxxxxx.Platform.Resource.Metadata.DataModel.ModelView, xxxxxx.Platform.XForm.SPI.TransferState, xxxxxx.Platform.AppFramework.Service.GSPState)
0030e9c4 1eff4b38 xxxxxx.Platform.XFormEngine.Core.ResourceFetcher.GetInstanceXml(xxxxxx.Platform.XForm.SPI.DataURI, System.String, xxxxxx.Platform.Resource.Metadata.DataModel.ModelView, xxxxxx.Platform.XForm.SPI.TransferState, xxxxxx.Platform.AppFramework.Service.GSPState)
0030e9ec 1eff1614 xxxxxx.Platform.XFormEngine.MLFC.XFML.DOM.InstanceElement.LoadInstanceData(xxxxxx.Platform.XForm.SPI.DataURI)
0030ea44 1eff0c08 xxxxxx.Platform.XFormEngine.MLFC.XFML.DOM.InstanceElement.LoadData(xxxxxx.Platform.XForm.SPI.DataURI)
0030ea7c 1dc33731 xxxxxx.Platform.XFormController.ModelController.CardModelController.LoadData(System.Data.DataRow, Boolean)
0030eaa0 1dc335d2 xxxxxx.Platform.XFormController.FormController.Basic.TreeController.Tree_SelectedChanged(System.Object, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs)
0030eac0 000bd7a7 [MulticastFrame:

0030eac0] DevExpress.XtraTreeList.FocusedNodeChangedEventHandler.Invoke(System.Object, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs) 0030eaec 1e06fdfd xxxxxx.Platform.XFormEngine.MLFC.XFML.DOM.TreeElement.OnSelectedNodeChanged(DevExpress.XtraTreeList.FocusedNodeChangedEventArgs) 0030eb00 1e06fd54 xxxxxx.Platform.XFormEngine.MLFC.XFML.DOM.TreeElement.VisualComponent_FocusedNodeChanged(System.Object, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs) 0030eb14 16434f98 DevExpress.XtraTreeList.TreeList.RaiseFocusedNodeChanged(DevExpress.XtraTreeList.Nodes.TreeListNode, DevExpress.XtraTreeList.Nodes.TreeListNode) 0030eb2c 1dec1c32 DevExpress.XtraTreeList.TreeList.InternalSetFocusedRowIndex(

Int32)
0030eb74 1dec1590 DevExpress.XtraTreeList.TreeList.set_FocusedRowIndex(Int32)
0030eb84 1e05b27e DevExpress.XtraTreeList.Handler.TreeListHandler+NodePressedState.ChangeSelection(DevExpress.XtraTreeList.ViewInfo.RowInfo)
0030ebac 1e05b038 DevExpress.XtraTreeList.Handler.TreeListHandler+NodePressedState.Init()
0030ebd0 162dfe7e DevExpress.XtraTreeList.Handler.TreeListHandler.SetControlState(DevExpress.XtraTreeList.TreeListState)
0030ebe0 1e05aeff DevExpress.XtraTreeList.Handler.TreeListHandler+NormalState.OnPressNode()
0030ebe4 1e05adc0 DevExpress.XtraTreeList.Handler.TreeListHandler+NormalState.MouseDown(System.Windows.Forms.MouseEventArgs, DevExpress.XtraTreeList.TreeListHitTest)
0030ec0c 1e05ac52 DevExpress.XtraTreeList.Handler.TreeListHandler.OnMouseDown(System.Windows.Forms.MouseEventArgs)
0030ec34 1e05abca DevExpress.XtraTreeList.TreeList.OnMouseDown(System.Windows.Forms.MouseEventArgs)
0030ec58 557f09bb System.Windows.Forms.Control.WmMouseDown(System.Windows.Forms.Message ByRef, System.Windows.Forms.MouseButtons, Int32)
0030ec74 552e57d3 System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
0030ec78 16431287 [InlinedCallFrame:

0030ec78] 0030ecb8

16431287

DevExpress.XtraEditors.Container.EditorContainer.WndProc(System.Windows.Forms.Message ByRef) 0030eccc 164311a5 DevExpress.XtraTreeList.TreeList.WndProc(System.Windows.Forms.Message ByRef) 0030ecdc 552e5263 System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef) 0030ece4 552e51e1 System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef) 0030ecf8 552e50f6 System.Windows.Forms.NativeWindow.Callback(IntPtr,

Int32, IntPtr, IntPtr)
0030ee84 000cd30a [InlinedCallFrame:

0030ee84] 0030ee80 5530548c DomainBoundILStubClass.IL_STUB_PInvoke(MSG ByRef) 0030ee84 552f6292 [InlinedCallFrame: 0030ee84] System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef) 0030eeb8 552f6292 System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32,

Int32)
0030eebc 552f5e6a [InlinedCallFrame:

0030eebc] 0030ef44 552f5e6a System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(

Int32, System.Windows.Forms.ApplicationContext)
0030ef88 552f5bd0 System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
0030efb4 55286981

System.Windows.Forms.Application.Run(System.Windows.Forms.Form) 0030efc8 1e72c14f xxxxxx.Platform.AppFrameworkGui.Commands.StartWorkbenchCommand.Run(System.String[]) 0030efdc 12b8b5d6 ***

WARNING:

Unable to verify checksum for GSFramework.exe *** ERROR: Module load completed but symbols couldnot

be loaded for GSFramework.exe
xxxxxx.Platform.FrameworkGui.Portal.FrameworkMain.RunApplication()
0030f004 0020c2e5 xxxxxx.Platform.FrameworkGui.Portal.FrameworkMain.Run()
0030f094 00201b05 xxxxxx.Platform.FrameworkGui.Portal.FrameworkMain.Main(System.String[])
0030f2a0 70461276 [GCFrame: 0030f2a0]

同时打开Network Monitor的网络抓包,结果发现客户端最后的http请求中包含invokeStream的字样。请求文本的内容中包含:XXXXXX.TB.ZXYJ.Com.XXXXXX.TB.ZXYJ.Com.TBDYGXCom.AddLB命名空间、方法等信息。

根据请求中的代码关键字找到客户端dll文件,反射查看代码内容发现,该方法调用了InvokeStream流操作但并未关闭,进而造成客户端挂起。

【问题解决】:

修改代码,使用using或finally关闭流操作,测试验证无问题,问题解决。

时间: 2024-08-06 22:20:43

【性能诊断】十、性能问题综合分析(案例1,windbg、Network Monitor)的相关文章

Web 2.0应用客户端性能问题十大根源

原文 http://www.infoq.com/cn/news/2010/08/web-performance-root/ Web 2.0应用的推广为用户带来了全新的体验,同时也让开发人员更加关注客户端性能问题.最近,资深Web性能诊断专家.知名工具dynatrace的创始人之一Andreas Grabner根据自己的工作经验,总结了Web 2.0应用客户端性能问题十大根源,InfoQ中文站将这十个问题做了概括整理,供Web开发人员借鉴和思考. 1. IE中的CSS选择器(selector)运行

60,000毫秒内对Linux的性能诊断效的方法

转载于:http://www.itxuexiwang.com/a/liunxjishu/2016/0225/168.html?1456484140 60,000 毫秒内对 Linux 的性能诊断 当你为了解决一个性能问题登录到一台 Linux 服务器:在第一分钟你应该检查些什么? 在 Netflix,我们有一个巨大的 EC2 Linux 云,以及大量的性能分析工具来监控和诊断其性能.其中包括用于云监控的 Atlas,以及用于按需实例分析的 Vector.虽然这些工具可以帮助我们解决大多数问题,但

Oracle数据库性能优化视频课程套餐(案例、实战、详细、全面)

套餐名称: Oracle数据库性能优化视频课程套餐(案例.实战.详细.全面) 套餐介绍: 风哥Oracle数据库性能优化培训套餐(案例.实战.详细.全面),包括内容: Oracle性能优化之执行计划管理.统计信息管理.性能诊断工具.性能跟踪工具.分区表管理.资源管理.操作系统工具.性能调整.物化视图.JOB自动任务管理等,套餐涉及10套课程,60个小时的课程,大量的案例. 套餐地址: http://edu.51cto.com/pack/view/id-974.html

利用Oracle RUEI+EM12c进行应用的“端到端”性能诊断

概述 我们知道,影响一个B/S应用性能的因素,粗略地说,有以下几个大的环节: 1. 客户端环节 2. 网络环节(可能包括WAN和LAN) 3. 应用及中间层环节 4. 数据库层环节 能够对各个环节的问题进行"贯穿"的诊断,才能算是"端到端"的诊断. 能够进行这种类型的诊断的工具很多,我们后面会分别介绍,今天只是给大家看看利用Oracle的工具软件进行从最前端到最后端的应用性能诊断的例子. 涉及的Oracle软件产品有以下几个: RUEI(真是的客户体验洞察) EM1

Web 2.0应用客户端性能问题十大根源《转载》

前言 Web 2.0应用的推广为用户带来了全新的体验,同时也让开发人员更加关注客户端性能问题.最近,资深Web性能诊断专家.知名工具dynatrace的创始人之一Andreas Grabner根据自己的工作经验,总结了Web 2.0应用客户端性能问题十大根源,InfoQ中文站将这十个问题做了概括整理,供Web开发人员借鉴和思考. 1. IE中的CSS选择器(selector)运行缓慢 Web开发人员通常使用JavaScript框架(如jQuery)提供的CSS选择器来实现查找功能,如var el

Oracle性能优化之性能诊断工具_超越OCP精通Oracle视频教程培训33

Oracle性能优化之性能诊断工具_超越OCP精通Oracle视频教程培训33 课程介绍 Oracle视频教程,风哥本套oracle教程培训<<Oracle数据库性能优化培训教程>>的第3/10套:Oracle性能优化之性能诊断工具.主要学习Oracle性能优化,Oracle自带性能诊断工具介绍,日常维护中的性能工具操作过程,awr性能数据的收集时间,awr自动收集性能报告如何实现,awr手工快照如何实现,awr baseline的手工调整与管理,awr性能相关的视图介绍,awr性

60,000毫秒内对Linux进行性能诊断

当你登陆上一个有性能问题的Linux服务器:在第一分钟你会做什么? 在Netflix我们有大规模的EC2 Linux云,也有许多性能分析工具来监控和诊断服务器性能.例如针对云监控的Atlas,针对on-demand机器分析的Vector.这些工具帮助我们解决了大部分问题,但我们偶尔也需要登录服务器,并且运行一些标准的Linux性能工具. 在本文中,Netflix性能工程师团队将介绍,在命令行中,对性能问题分析时所使用的标准Linux工具,前60秒做的事情. 最初60秒:摘要 通过下面10个命令,

性能诊断与SQL优化

AUTOTRACE 功能辅助SQL优化 安装, 参考PL/SQL环境设置博文 autotrace 常用选项: set autotrace off, 不生成autotrace 报告, 这是缺省值 set autotrace on explain: autotrace 只显示优化器执行路径报告 set autotrace on statistics: 只显示执行统计信息 set autotrace on: 即包含统计信息, 又包含执行计划 set autotrace traceonly: 同set

linux 性能诊断工具命令集

#查看当前系统load uptime #查看系统状态和每个进程的系统资源使用状况 top #可视化显示CPU的使用状况 htop #查看每个CPU的负载信息 mpstat -P ALL 1 #每隔1秒查看磁盘IO的统计信息 iostat -xkdz 1 #每隔一秒查看虚拟内存的使用信息 vmstat 1 #查看内存使用统计信息 free #查看网络使用信息 nicstat -z 1 #类似vmstat的显示优化的工具 dstat 1 #查看系统活动状态,比如系统分页统计,块设备IO统计等 sar

MySQL性能诊断与调优

[MySQL性能诊断与调优] LAMP 系统性能调优,第 3 部分: MySQL 服务器调优 http://www.ibm.com/developerworks/cn/linux/l-tune-lamp-3.html LoadRunner监控MySQL http://www.docin.com/p-92272846.html Advanced MySQL Performance Optimization http://www.mysqlperformanceblog.com/files/pres