This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11351|Reply: 3

[Web] IIS initialization solves the problem of slow first access and program pool being reclaimed

[Copy link]
Posted on 8/1/2019 4:47:32 PM | | | |
You think you can be slow, that's impossible! You think you can stay still, but that's impossible!

Henan is the birthplace of the storyline of waiting for the rabbit, which tells the story of a lazy farmer sitting by a stump waiting for the cute little rabbit to hit the tree, so how can this kind of thing happen every day! What you think will always work out the way you think, so taking the initiative will be the most effective way! Every saint has a past, every sinner has a future!

Read to the top:

1. This article takes IIS8 and Windows Server 2012R2 as examples

2. IIS8 runs on Windows Server 2012 and Windows 8 versions and above.

3. The application pool and website exist separately in IIS, but the website operation must be based on the premise that the corresponding application pool is started.

4. By default, the application pool will be automatically reclaimed by IIS after a period of inactivity (no requested operations).

5. IIS8 comes with an application initialization toolkit, IIS7.5 needs to search for independent installation packages for installation, and IIS automatic initialization is not supported for the time being lower than 7.5.

6. This case method can solve the problem of slow access ASP.Net the first time and slow access after a period of time.

Let's get moving!

1. Install the IIS application initialization function

As shown below:



2. Edit the startup mode of the corresponding application pool on the website

As shown in the figure below, the operation path is as follows: Application Pool - > Website Corresponding Program Pool - > Right-click, Advanced Settings - > Selection, Startup Mode AlwaysRunning



3. Enable the corresponding website preload
As shown in the figure below, the operation path: Website -> Corresponding website -> Right-click, Advanced Settings -> selection, preload is enabled True



4. Set the configuration editor and write the default preload request

As shown in the figure below, open the configuration editor




As shown in the figure below: In the upper left corner, select system.webServer/applicationInitialization for the configuration node, and other configurations are in the red circle



As shown in the figure below: Add an initialization request address (for IIS initialization default request address) to the collection, and click the Apply button on the right side of the configuration interface.and restart the app pool and website



Remark:

1. Principle description: IIS application initialization will automatically open a new program pool after the first creation of the website or after the application pool of the corresponding website is recycled, and start the website initialization, simulating a normal request to keep the website online.

(This process can be used to simulate website requests with the help of third-party tools or services)

2. Configuration description:

(1) Enable AlwaysRunning: Ensure that the application pool can automatically restart running after being created or recycled for the first time.

(2) Enable website program preloading (true): Ensure that the website can respond to the preload action after the program pool is started.

(3) Configure the default preload path of the website: ensure that the program can quickly compile the program and enter the memory during the preloading process after the program pool is started, so as to ensure a quick response to requests.


(End)





Previous:C# classes, static classes, static variables, initialize the execution order
Next:Barbecue encyclopedia, if you want to learn barbecue, please take a look
 Landlord| Posted on 8/1/2019 4:47:53 PM |
If you restart the process, all variables will be lost. However: when the pool is recalculated, IIS automatically serializes the session variable into another process memory. When the pool is restarted, the session variables are deserialized, allowing for recovery. This is done through . .NET serialization feature is done, which means that all session variables must be tagged with the [Serializable] attribute or you will get runtime activation.
 Landlord| Posted on 8/1/2019 4:59:21 PM |
Auto-start ASP.NET applications (VS 2010 and . NET 4.0 series)
https://weblogs.asp.net/scottgu/ ... -and-net-4-0-series
 Landlord| Posted on 8/6/2019 2:40:27 PM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com