简体   繁体   English

IIS ASP.net应用程序突然挂起请求

[英]IIS ASP.net application suddenly hangs requests

We have an asp.net application running on IIS 8.5, when there is high traffic, intermittently by about 1 minute, "requests queue" starts to grow and processor time goes down, look at the performance monitor graph: 我们有一个运行在IIS 8.5上的asp.net应用程序,当通信量很大时,间歇地(大约1分钟),“请求队列”开始增长,处理器时间减少,请查看性能监视器图:

红色是处理器时间,绿色是请求队列

The strange thing is that there is no application restart, 503 or IIS recycle occurring, so what could it be? 奇怪的是,没有重新启动应用程序,没有发生503或IIS回收,那会是什么呢? What suddenly makes the IIS hang the requests for a while? 是什么突然使IIS挂起了请求一段时间? Besides the graph, you can see that Windows's memory looks ok and stable. 除了该图以外,您还可以看到Windows的内存看起来不错且稳定。

Here is some environment configurations: APP Pool Queue length: 10000 (there is no 503, so I don't think could it be this) 这是一些环境配置:APP池队列长度:10000(没有503,所以我认为可能不是这样)

Asp.net config: Asp.net配置:

 <system.web>
     <applicationPool maxConcurrentRequestsPerCPU="999999" />
 </system.web>

machine.config: machine.config中:

<processModel autoConfig="false" requestQueueLimit="250000"/>

We configured things this way because our application uses a lot of SignalR. 我们以这种方式配置事物,因为我们的应用程序使用了大量SignalR。

The application uses Azure SQL Server and Azure Redis, but this is not the problem since another Virtual Machine (with the same APP) doesn't show the problem at the same moment. 该应用程序使用Azure SQL Server和Azure Redis,但这不是问题,因为另一个虚拟机(具有相同的APP)不会同时显示此问题。

Another tip is that: In the same VM, we have the same APP but in another Application Pool and another domain that behaves equal. 另一个提示是:在同一个VM中,我们有相同的APP,但在另一个Application Pool和另一个行为相同的域中。

Any help would be appreciated, this is driving me crazy. 任何帮助将不胜感激,这让我发疯。

Thanks! 谢谢!

Did you follow the recommendations regarding configuring the threadpool growth settings that Redis provides, see here . 您是否遵循有关配置Redis提供的有关线程池增长设置的建议,请参见此处 Had similar issues. 有类似的问题。

In the environment you have described, I will look at below points 在您描述的环境中,我将介绍以下几点

  1. have a look at DTU percentage for Azure SQL server, if your signalr operations has anything to do with database. 如果您的信号操作与数据库有关,请查看Azure SQL服务器的DTU百分比。 just try going one level up in DTU Scale to handle burst. 只需尝试在DTU Scale中上一层即可处理突发。 DTU DTU
  2. for an app with signalr with multiple virtual machine (assuming load balanced), do you have central signalr server or each server behaving as signalr server ? 对于具有带有多个虚拟机的Signalr的应用程序(假设负载均衡),您是否具有中央Signalr服务器或每个服务器均充当Signalr Server?

if you can install NewRelic or similar, it will point to source of problem. 如果您可以安装NewRelic或类似的产品,它将指向问题的根源。

Hope it helps. 希望能帮助到你。

You could take a memory dump of the process when the problem is happening (one way is using Task Manager), although if there are multiple IIS app pools running on the machine, finding the correct process to take a memory dump of might be non-trivial. 当问题发生时(一种方法是使用任务管理器),您可以对进程进行内存转储,尽管如果计算机上运行着多个IIS应用程序池,则找到与之进行内存转储的正确进程可能不可行。不重要的。

If you have Visual Studio Enterprise, then it will give you a nice UI to analyse the dump. 如果您拥有Visual Studio Enterprise,那么它将为您提供一个不错的UI,以分析转储。 It will show you all the threads running the process and what the callstack was at the time of the memory dump. 它将显示运行该进程的所有线程以及内存转储时的调用堆栈。 You'll probably find most of the .NET threads have a similar callstack, which would be the most likely cause of the bottleneck. 您可能会发现大多数.NET线程都具有类似的调用堆栈,这很可能是造成瓶颈的原因。

If you don't have Visual Studio Enterprise, then I think you can still open it with WinDbg, but it's a CLI tool and I don't know the commands, so you'll need to look it up. 如果您没有Visual Studio Enterprise,那么我认为您仍然可以使用WinDbg打开它,但这是一个CLI工具,并且我不知道命令,因此您需要对其进行查找。

Add another counter to your graph: Private Bytes . 在图形中添加另一个计数器: Private Bytes This number will tell you the number of bytes in all in all managed heaps + the number of unmanaged bytes. 此数字将告诉您所有托管堆中所有字节的总数+非托管字节的数量。 If that number keeps increasing, then you have a memory leak somewhere. 如果该数字持续增加,那么您的某处内存泄漏。 Ensure all disposable objects are disposed of properly and items are not surviving until G3 collection. 确保妥善处理所有一次性物品,并且直到G3收集后物品才能幸存。 Anyhow, I would start there and if this is the issue, I would start my investigation and see what is leaking. 无论如何,我将从那里开始,如果这是问题所在,我将开始调查并查看泄漏的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM