ASP.Net application runs slower for the first time

I have a web application written in ASP.Net 3.0 using C #, the production machine is a Windows 2003 server with IIS 6.0 and SQL Server 2005.

Application structure

The structure of my ASP.net web application is shown below:

the root application in IIS (// localhost / es) includes shared pages, for example: master pages, theme, user control, image folder. the number of subprojects in the root application (// localhost / es / sub-project). delete web.config in subprojects to collect subproject files located in the bin folder of the root application (sub-project properties → compile → build output path: .. \ bin \ my application is a three-level web application (Biasness layer, data level and presentation level. In addition, each aspx page has its own code behind the cs file)

IIS Settings

Application Pool Processing a Workflow after "1740 Minutes" Idle Workflow Waiting after a Downtime of "20 Minutes" A Ping Worker Processes Every "30 Seconds"
Start-up time limit for a 90-second workflow Time-out limit for a 90-second workflow

Application configuration
Cached files with limited access in memory "500"

ASP cache files on disk "2000"

Application Deployment:

I am publishing a web application with all its files to a production server.

Problem:

The application starts quite slowly for the first time, it takes more than 10 seconds to load, however, each time the next page request is made it will be faster. I believe that the first time a page is requested, it compiles and usually takes longer than the other requestor, because the page is in Cache. The question is, why does it take time when compiling the page for the first time?

Attempts to solve the problem:

I tried to do the following:

  • Deploy a copy of the required files to the production server.
  • IIS settings changed, workflow shutdown timeout changed
  • Disable trace
  • Disable Session State
  • Disable pageview state
  • Set debug = false in web.config
  • Creating a hello world subproject under the root application takes 5 seconds.
  • Creating a standalone hello word web application, as described above, takes a lot of time to download.
  • Remove the code in the page_load event handler, but it did not affect performance.
  • Publish only the necessary file of the root application (the code is not written in the code behind) and the entire file in the source code of the subproject (the code is in the code behind),

However, the application still starts slowly, but then it becomes faster.

Please help diagnose and solve this problem.

+6
performance web-applications iis-6 publish
source share
9 answers

In addition to what the sky says, you can run a “warmup script” as the last step of the deployment process. Although this will not speed up the time required for the first compilation, using such a script will at least allow users to see a slow start. Look here for an example of such a script: http://programmerramblings.blogspot.com/2008/09/aspnet-site-warmup.html

Another reason that the very first request to your application is slow may be that IIS must start the asp.net workflow during the very first request. However, this should not affect the first requests to other pages.

+5
source share

Publish a website that precompiles, not copies.

The behavior you experience is normal.

+2
source share

I had the same thing in a ruby ​​on rails application with a passenger, but I found a good tool ( http://www.wekkars.com ) that just keeps the web server from sleeping.

+1
source share

You can also use the automatic application launch feature available for the .net framework 4 web applications. For more information, visit here .

+1
source share
0
source share
VBscript + Dos Batch file... run every 1 hr Dim strNewTime , strSiteName strNewTime = Now() strNewTime = Replace(strNewTime, "/","") strNewTime = Replace(strNewTime, " ","") strNewTime = Replace(strNewTime, ":","") strSiteName = "https://www.yoursite.com/userlogin.aspx?dummytime=" + strNewTime Dim oXMLHTTP Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0") oXMLHTTP.Open "GET", strSiteName, False oXMLHTTP.Send If oXMLHTTP.Status = 200 Then ' working ELSE CALL SendEmail("!!! www - web site is NOT working... " + strSiteName + " *** ") End If Set oXMLHTTP = Nothing 
0
source share

There will always be a slight delay when you first load any .NET application due to the CLR component on the .NET Framework. Since JIT (Just in Time), located inside the CLR (runtime for ASP.NET), converts an intermediate language (IL) into native machine code, it will always take a little longer when you first run .net applications.

A detailed video on this specific issue can be viewed on the page:

https://www.youtube.com/watch?v=ruf4U9_Rbss&index=1&list=PL8598C97BA1D871C1

Hope this helps.

0
source share

For asp.net applications running in IIS 7.0 and later, writing a warm-up program or script is the best way to prevent application pool timeouts. This warm-up trigger can be configured from the same application or from external websites or programs. You can find various ways to achieve this in the article.

0
source share

There is no way around this. You will always get a little delay on the first load when compiling the site.

-4
source share

All Articles