简体   繁体   English

重新启动应用程序池后,IIS服务器从0-100%跳

[英]IIS Server Jumping from 0-100% shortly after application pool restart

I had my 'Timeout limit' set to 5 minutes on the app pool for my site. 我在网站的应用程序池中将“超时限制”设置为5分钟。

I noticed that it was frequently stopping and restarting. 我注意到它经常停止并重新启动。 Shortly after the app pool restarts the w3svc.exe starts with strange behaviour where the CPU shoots up and down from between 0 and 100%. 应用程序池重新启动后不久, w3svc.exe以奇怪的行为启动,其中CPU从0%到100%之间突然上升和下降。

Before the CPU begins shooting up and down the app is accessible from the browser, so its as if the app is already 'running' so I perceive it as started... If that means any thing. 在CPU开始上下射击之前,可以通过浏览器访问该应用程序,因此就好像该应用程序已经在“运行”,因此我认为它已启动...如果这意味着任何事情。

I was panicking initially when I saw it as I feared it might be the code in my C# ASP.NET MVC app, but then I realised that this calms down after about 5 minutes of shooting up and down and the memory and CPU usage returns back to an acceptable state. 最初,我担心它可能是我的C#ASP.NET MVC应用程序中的代码,当我惊慌失措时,但是后来我意识到,经过大约5分钟的反复拍摄后,这种情况会平静下来,并且内存和CPU使用率又恢复了达到可接受的状态。

I've set my timeout on the app pool to 0 to prevent it from frequently entering this cycle, but I'm not exactly sure what its doing so I'd like to fine tune it. 我已将应用程序池上的超时设置为0,以防止它频繁进入此周期,但是我不确定它在做什么,因此我想对其进行微调。

I've been looking up things to do with caching as I fear that the server might be caching my entire /Content folder which contains several thousands of images. 我一直在寻找与缓存有关的事情,因为我担心服务器可能会缓存包含数千张图像的整个/Content文件夹。

The default application pool timeout is 1740 (29 hours). 默认的应用程序池超时为1740(29小时)。 It is normal for an application pool to require resources for a few minutes when it starts or recycles. 应用程序池在启动或回收时通常需要几分钟的资源。 However, if you set it to something as low as 5 minutes, it may be recycling before the warm-up process is finished, so it is perpetually eating up resources. 但是,如果将其设置为低至5分钟,则可能在预热过程完成之前就将其回收,因此它将永久消耗资源。

I am not sure what you hope to gain by setting the application pool to recycle every 5 minutes, but both in-process session state and cached items that are not specified as "not removable" will be reset every time the pool restarts, which will cause other issues if your application depends on them. 我不确定您希望通过将应用程序池设置为每5分钟回收一次来获得什么,但是每次重新启动池时,都会重置进程内会话状态和未指定为“不可移动”的缓存项。如果您的应用程序依赖其他问题,则会导致其他问题。

The application pool has nothing at all to do with server-side caching. 应用程序池与服务器端缓存完全无关。 And unless you have explicitly written code to cache them, images are normally cached on the client, which doesn't eat up resources on your server. 而且,除非您已明确编写代码来缓存它们,否则图像通常会缓存在客户端上,这不会占用服务器上的资源。

That said, proper use of caching is something that will improve a web server's performance, not hinder it. 就是说,正确使用缓存可以提高 Web服务器的性能,而不是阻碍其性能。

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

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