First request is very slow after website sits idle with ASP.NET MVC 3 (IIS7)(在网站使用 ASP.NET MVC 3 (IIS7) 闲置后,第一个请求非常慢)
问题描述
我在 ASP.Net MVC 3 中开发了一个项目,我的主机使用的是 iis7 (Win Web Serv 2008 R2),网站闲置后的第一个请求(大约 1-2 小时)非常慢.
I developed a project in ASP.Net MVC 3, my hosting is using iis7 (Win Web Serv 2008 R2), and the first request after the website sit's idle (during about 1-2 hours) is very slow.
我使用具有 512Mb RAM 的 VPS.这可能与 RAM 太少有关吗?
I use VPS with 512Mb RAM. Can this be related with a too little RAM?
谁能帮我解决这种行为的可能原因?
Can anyone help me with possible causes of such behaviour?
推荐答案
在一定数量的不活动后,IIS 会卸载 AppDomain.然后第一个请求再次加载应用程序,速度较慢.您可以尝试在 IIS 的属性中配置此时间段,但也可能存在应用程序卸载的其他原因,例如达到特定的 CPU 或内存使用阈值.这些阈值也可以在 IIS 中进行配置.
After a certain amount of inactivity IIS unloads the AppDomain. And then the first request loads the application once again which is slower. You could try to configure this period in the properties of IIS but there might also be other causes that an application unloads such as for example a certain threshold of CPU or memory usage is reached. Those thresholds are also configurable in IIS.
这不是 ASP.NET MVC 所特有的.一般而言,所有 ASP.NET 应用程序都是如此.
That's not something specific for ASP.NET MVC. It's true for all ASP.NET applications in general.
这篇关于在网站使用 ASP.NET MVC 3 (IIS7) 闲置后,第一个请求非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在网站使用 ASP.NET MVC 3 (IIS7) 闲置后,第一个请求非常慢


基础教程推荐
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01