Home  >  Article  >  Backend Development  >  How to solve the problem of slow first access to ASP.NET website

How to solve the problem of slow first access to ASP.NET website

怪我咯
怪我咯Original
2017-04-08 10:46:402811browse

This article mainly introduces in detail the solution to the slow first access to ASP.NET on IIS8. It has certain reference value for those who are interested. You can refer to

The experience in this article uses IIS8 and Windows Server 2012R2 as cases.

IIS8 runs on Windows Server 2012 and Windows 8 and above platforms.

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.

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

IIS8 comes with its own application initialization toolkit. For IIS7.5, you need to search for the independent installation package to install. For versions lower than 7.5, IIS automatic initialization is not currently supported.

The method in this article’s experience can solve the problem of slow access to ASP.Net for the first time, and then again after a period of time.

Method/Step

Install the IIS application initialization function, as shown in the figure below:

Edit website Corresponding to the application pool startup mode, the operation path is: Application Pool-> Website Corresponding Program Pool-> Right-click, Advanced Settings-> Select the startup mode AlwaysRunning, as shown in the following figure:

Enable corresponding website preloading, operation path: Website-> Corresponding website-> Right-click, Advanced Settings-> Select, preloading is enabled True, as shown in the following figure:

Set up the configuration editor, write the default preload request, and open the configuration editor, as shown below:

Configure the node in the upper left corner Select system.webServer/applicationInitialization, and other configurations are in the red circle, as shown in the following figure:

Add an initialization request address in the collection (used for IIS initialization default request address ), after the addition is completed, click the Application button on the right side of the configuration interface, and restart the application pool and website, as shown in the following figure:

Summary:

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

(This process can use third-party tools or services to simulate website requests to achieve the same purpose)

2. Configuration instructions:

(1), enable application pool (AlwaysRunning ): Ensure that the application pool can be automatically restarted after it is first created or recycled.

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

(3) Configure the default preloading path of the website: ensure that after the program pool is started, the program can be quickly compiled and stored in the memory during the website preloading process, ensuring fast response to requests.


##

The above is the detailed content of How to solve the problem of slow first access to ASP.NET website. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn