ASP.Net first visit to resolve slow process (IIS8) solve ASP.Net first visit to the slow processing (IIS8)

Benpian experience with IIS8, Windows Server 2012R2 as a case study.

IIS8 operating platform in Windows Server 2012 and Windows 8 version of the above.

IIS application pool and Web sites exist alone, but the site must be built on the premise of running a corresponding application pool starts.

By default, the application pool without activity (no request operation), after a period of time, will be automatically recovered IIS out.

IIS8 own application initialization tool kit, IIS7.5 to search for a standalone installation package to install, less than IIS 7.5 does not support automatic initialization.

Methods Benpian experience can solve the problem ASP.Net first visit to slow, after a time lag, and access slow.

1, the installation IIS application initialization function, as shown below:

2, corresponding to the website editing application pool startup mode operation path: Application Pools -> cell site corresponding to the program -> right, Advanced Settings -> select, start mode AlwaysRunning, as shown below:

3, corresponding to the open sites preload operation path: Website -> corresponding to the site -> right, Advanced Settings -> select, True preload is enabled, as shown below:

4, set the configuration editor, preloading the default write request to open the configuration editor, as shown below:

5, select system.webServer / applicationInitialization in the upper left node configuration, other configurations such as a red circle, as shown below:

6, was added in an initialization request set addresses (address request for default initialization IIS), After the addition was complete, the right click button of application configuration interface, and restart the application pool and the site, as shown below:

7. Summary:

(1) Rationale:

          IIS application initialization or correspond to application pool recycling site, the site automatically open after the first time you create a new application pool, and launch site initialization, simulate a normal request, the site has been online. (This process can make use of third-party tools or services the site mock request for the same purpose)

(2)配置说明:

 (a)、启用应用程序池(AlwaysRunning):保证应用程序池在第一次创建或者被回收后,能自动再次重启运行。

 (b)、启用网站程序预加载(true):保证程序池在启动过后,网站能响应预加载动作。

 (c)、配置网站默认预加载路径:保证程序在程序池启动后,网站预加载过程中,能快速编译程序并进驻内存,保证请求快速响应。

本篇经验以IIS8,Windows Server 2012R2做为案例。

IIS8 运行在 Windows Server 2012 and Windows 8 版本以上的平台上。

IIS中应用程序池和网站是单独存在的,但是网站运行必须建立在对应的应用程序池启动的前提下。

默认情况下,应用程序池在不活动情况下(无请求操作),一段时间后,将被IIS自动回收掉。

IIS8 自带应用程序初始化工具包,IIS7.5要搜索独立安装包进行安装,低于7.5的暂时不支持IIS自动初始化。

本篇经验中的方法能解决ASP.Net第一次访问慢,间隔一段时间后,又访问慢的问题。

1、安装IIS应用程序初始化功能,如下图所示:

2、编辑网站对应应用程序池启动模式,操作路径:应用程序池 -> 网站对应程序池 -> 右键,高级设置 ->选择,启动模式 AlwaysRunning,如下图所示:

3、开启对应网站预加载,操作路径:网站 -> 对应网站 -> 右键,高级设置 ->选择,预加载已启用 True,如下图所示:

4、设置配置编辑器,编写默认预加载请求,打开配置编辑器,如下图所示:

5、在左上角配置节点选择system.webServer/applicationInitialization,其他配置如红圈中,如下图所示:

6、在集合中添加一个初始化请求地址(用于IIS初始化默认请求地址),添加完成后,点击配置界面右侧的应用按钮,并重启应用程序池和网站,如下图所示:

7、总结:

(1)原理说明:

          IIS应用初始化会在网站第一次创建后或者对应网站的应用程序池回收后,自动开启新程序池,并启动网站初始化,模拟一次正常请求,使网站一直处于在线状态。(此流程可以借助第三方工具或者服务模拟网站请求达到相同目的)

(2)配置说明:

 (a)、启用应用程序池(AlwaysRunning):保证应用程序池在第一次创建或者被回收后,能自动再次重启运行。

 (b)、启用网站程序预加载(true):保证程序池在启动过后,网站能响应预加载动作。

 (c)、配置网站默认预加载路径:保证程序在程序池启动后,网站预加载过程中,能快速编译程序并进驻内存,保证请求快速响应。

Guess you like

Origin www.cnblogs.com/zxtceq/p/10954002.html