Solution to slow access to ASP. NET websites for the first time, asp.net Solution
This article uses IIS8 and Windows Server 2012R2 as examples.
IIS8 runs on a platform of Windows Server 2012 and Windows 8 or later.
In IIS, the application pool and website exist independently, but the website must be started on the premise that the corresponding application pool starts.
By default, when the application pool is not active (no request operation), it will be automatically reclaimed by IIS after a period of time.
IIS8 comes with the application initialization toolkit. IIS7.5 needs to search for an independent installation package for installation. IIS automatic Initialization is not supported for versions earlier than 7.5.
The methods in this article can solve the problem of slow access for ASP. Net for the first time and slow access after a period of time.
Method/step
Install the IIS application initialization function, as shown in:
Edit the application pool Startup Mode for the website. Operation path: application pool-> application pool for the website-> right-click, advanced settings-> select, and enable AlwaysRunning, as shown in:
Enable pre-loading for the corresponding website. The operation path is "website"> "corresponding website"> "right-click", Advanced Settings ">" select "." True "is enabled for pre-loading, as shown in:
Set the configuration Editor, write the default preload request, and open the configuration Editor, as shown in:
In the upper left corner of the configuration node, select system. webServer/applicationInitialization. Other configurations are shown in red circles, as shown in:
Add an initialization request address (for IIS to initialize the default request address) in the collection. After adding the address, click the application button on the right of the configuration page and restart the application pool and website, as shown in:
Summary:
1. Principle Description: After the IIS application Initialization is created for the first time or the application pool of the corresponding website is recycled, the new application pool is automatically started, website Initialization is started, and a normal request is simulated, keeps your website online.
(This process can achieve the same purpose by simulating website requests using third-party tools or services)
2. configuration instructions:
(1) Enable the application pool (AlwaysRunning): ensure that the application pool can be restarted automatically after it is created or recycled for the first time.
(2) Enable website program pre-loading (true): ensure that the website can respond to the pre-loading action after the application pool is started.
(3) configure the default pre-loading path of the Website: ensure that the program can be quickly compiled and stored in the memory during the pre-loading process of the website after the program pool is started, so as to ensure fast response to requests.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.