循环使用IIS应用程序池导致缓慢的首次用户体验 [英] cycling IIS app pool cause slow first user experience

查看:70
本文介绍了循环使用IIS应用程序池导致缓慢的首次用户体验的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过IIS MMC回收Web应用程序的应用程序池时,第一个在Webapp中请求页面的用户会收到来自站点的非常慢的响应.在最初请求之后,此后的每个页面都可以.用户还可以注销该站点,稍后再返回,并且速度很快.我关心的是网站的最初的初始负载.如果我要在早上3点编写脚本以重新启动应用程序池,那么我还能做什么

When i recycle the application pool for my web app via IIS MMC, the first user to request a page within the webapp will experience a really slow response from the site. After that initial request, every page there after is fine. The user could also log off the site, come back later and the speeds are quick. My concern is with the first, initial load of the site. If i were to write a script to restart the application pool at 3am in the morning, what else can i do to either

a.)冒充用户访问该网站并让最初的缓慢负载发生,从而使该应用在早上为用户就绪".

a.) impersonate a user visiting the site and getting that initial slow load to happen, thus making the app "ready" for the users in the morning.

b.)告诉应用程序池假脱机化内存,而无需用户启动此过程.

b.) tell the app pool to spool up the memory and such without a user having to initiate this process.

推荐答案

首先,您不需要脚本即可在凌晨3点回收应用程序.应用程序池具有在回收时选择的设置.默认情况下,我认为它们每29小时进行一次回收,这是一个奇怪的设置,我建议您对其进行更改.否则,您会在一天中的随机时间接到呼叫,声称丢失了会话.

First, you don't need a script to recycle the app at 3 AM. The app pools have settings to choose when they recycle. By default, I think they recycle every 29 hours, which is an odd setting and I recommend changing it. Otherwise, you'll get calls claiming lost sessions at random times of the day.

我必须假定您有问题的应用程序池中有一个ASP.NET应用程序.在首次请求时,延迟主要是由于ASP.NET辅助进程需要编译网站和/或加载运行时所需的DLL.为了解决此问题,大多数使用保持活动任务,该任务可以定期向站点发出请求以确保站点已完全加载.Matt的建议也是不错的建议,但只有在您自己回收应用程序池时,才能解决该问题.应用程序池可以出于多种其他原因自行回收,并且保持活动状态可以在大多数时间内保持加载状态.

I must assume you have an ASP.NET application in the app pool in question. Upon first request, the delay is mostly due to the ASP.NET worker process needing to compile a Web site and/or load DLLs required at runtime. To solve this issue, most use a keep-alive task which can make regular requests to the site to ensure that it is fully loaded. Matt's suggestion is also a good one, but will only solve the issue when you are recycling the app pool yourself. App pools can recycle on their own for any number of other reasons and the keep-alive will be able to keep things loaded most of the time.

这篇关于循环使用IIS应用程序池导致缓慢的首次用户体验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆