After deploying a new version of a hybrid asp.net web application, Framework 4.5.1, IIS 7.5, we immediately noticed that CPU usage was spiking to 100%.
在部署新版本的混合asp.net Web应用程序Framework 4.5.1,IIS 7.5后,我们立即注意到CPU使用率达到了100%。
I followed CPU spike debugging using DebugDiag as described in this article: http://www.iis.net/learn/troubleshoot/performance-issues/troubleshooting-high-cpu-in-an-iis-7x-application-pool
我使用DebugDiag跟踪CPU峰值调试,如本文所述:http://www.iis.net/learn/troubleshoot/performance-issues/troubleshooting-high-cpu-in-an-iis-7x-application-pool
I now have my report, and every one of the threads identified as High CPU usage problems look like this, with varying thread numbers:
我现在有了我的报告,并且每个被识别为高CPU使用率问题的线程都是这样的,具有不同的线程数:
Thread 1576 - .SNIReadSyncOverAsync(SNI_ConnWrapper*, SNI_Packet**, Int32)
I'm guessing this means the culprit is a LINQ to SQL call. The application uses a lot of LINQ to SQL. Unfortunately the DebugDiag report gives no clue as to which LINQ to SQL call is causing the difficulty.
我猜这意味着罪魁祸首是LINQ to SQL调用。该应用程序使用了大量的LINQ to SQL。不幸的是,DebugDiag报告没有给出哪个LINQ to SQL调用导致困难的线索。
Is there any way to use the information in the DebugDiag report to identify the SQL Server calls that causes the High CPU usage?
有没有办法使用DebugDiag报告中的信息来识别导致高CPU使用率的SQL Server调用?
1 个解决方案
#1
0
We never did find an answer to the question. I was hoping for an answer that would tell us what we could add to the performance monitor data collection to see the actual SQL that was being passed by the threads that were spiking CPU.
我们从来没有找到问题的答案。我希望得到一个答案,告诉我们可以添加到性能监视器数据集合中,以查看正在加载CPU的线程传递的实际SQL。
Instead we ran SQL Server performance monitor, duly filtered to cover only traffic from the web application, for about a minute. We dumped all the data collected into a table, then examined statement start and end times to identify statements that were taking an inordinate amount of time. From this collection of sluggish statements we identified the SQL call that was spiking CPU.
相反,我们运行SQL Server性能监视器,适当过滤以仅覆盖来自Web应用程序的流量,大约一分钟。我们将收集的所有数据转储到表中,然后检查语句的开始和结束时间,以识别占用过多时间的语句。从这个缓慢的语句集合中,我们确定了SQL调用,它正在加速CPU。
Oddly enough, the SQL call (selecting the results of an Inline Table-Valued Function) takes 2-3 seconds to complete, but most of that time is taken with sql server breaking the connection (sp_reset_connection). The call itself returns in less than a millisecond, and when we execute the same function in SSMS using identical parameters the call executes in less than a millisecond. However, this will be the topic of a separate question.
奇怪的是,SQL调用(选择内联表值函数的结果)需要2-3秒才能完成,但大部分时间是在sql server断开连接(sp_reset_connection)时进行的。调用本身在不到一毫秒的时间内返回,当我们使用相同的参数在SSMS中执行相同的函数时,调用在不到一毫秒的时间内执行。但是,这将是一个单独问题的主题。
#1
0
We never did find an answer to the question. I was hoping for an answer that would tell us what we could add to the performance monitor data collection to see the actual SQL that was being passed by the threads that were spiking CPU.
我们从来没有找到问题的答案。我希望得到一个答案,告诉我们可以添加到性能监视器数据集合中,以查看正在加载CPU的线程传递的实际SQL。
Instead we ran SQL Server performance monitor, duly filtered to cover only traffic from the web application, for about a minute. We dumped all the data collected into a table, then examined statement start and end times to identify statements that were taking an inordinate amount of time. From this collection of sluggish statements we identified the SQL call that was spiking CPU.
相反,我们运行SQL Server性能监视器,适当过滤以仅覆盖来自Web应用程序的流量,大约一分钟。我们将收集的所有数据转储到表中,然后检查语句的开始和结束时间,以识别占用过多时间的语句。从这个缓慢的语句集合中,我们确定了SQL调用,它正在加速CPU。
Oddly enough, the SQL call (selecting the results of an Inline Table-Valued Function) takes 2-3 seconds to complete, but most of that time is taken with sql server breaking the connection (sp_reset_connection). The call itself returns in less than a millisecond, and when we execute the same function in SSMS using identical parameters the call executes in less than a millisecond. However, this will be the topic of a separate question.
奇怪的是,SQL调用(选择内联表值函数的结果)需要2-3秒才能完成,但大部分时间是在sql server断开连接(sp_reset_connection)时进行的。调用本身在不到一毫秒的时间内返回,当我们使用相同的参数在SSMS中执行相同的函数时,调用在不到一毫秒的时间内执行。但是,这将是一个单独问题的主题。