App Muncher

Issues faced - solutions identified - shared with community.

ASP .Net sites took ages to load webpage for first time

I was using IIS Version 7.5.7600.16385

The ASP.NET application was hosted on a report server, running multiple reporting sites.

Every day the first user opening any report site was a complaining of system performance.

I used the following procedure to overcome my problem.

  • Auto Start Web Application using ASP.NET

    Some web pages need to load huge amount of data or perform expensive initialization before they are ready to process requests.

    There are ways using Application_Start event handler within Global.asax of an application, using custom scripts to send fake requests to application. Thus periodically waking the application

    Or simply cause first user to wait while the logic finishes initialization

    ASP.NET provides a new feature called auto-start that addresses this scenario.

  • Configure Auto Start in ASP.NET 4 application

    Configure the IIS application pool worker thats linked to the application. Enable it to start when server first loads.

    Access applicationHost.config located at

    c:\windows\system32\inetsvr\config\applicationHost.config
    add attribute
    startMode="AlwaysRunning"


    <br /> <applicationpools><br /> <add name="MyAppPool" managedRuntimeVersion="v4.0" startMode="AlwaysRunning"/><br /> </applicationPools><br />

    As soon as you save the config file you will see the process w3wp.exe started.

    As one application pool may be linked to multiple sites, we can specify which application pool should be automatically started when the worker process is loaded.

    To perform the following attribute to the application configuration :


    <br /> <sites><br /> <site name="LDAPRep" id="LD1"><br /> <application path="../../" serviceAutoStartEnabled="true" serviceAutoSatrtProvider="WarmMyCache" /><br /> </site><br /> </sites><br /> <serviceautostartproviders><br /> <add name="WarmMyCache" type="WarmCache, MyFrame" /><br /> </ServiceAutoStartProviders><br /> <br />

No comments:

Post a Comment

| Designed by AppMuncher