Thursday, October 28, 2010

First request takes long time in a Asp.net web application

Application Pool recycle time interval.
When you deploy an Asp.net web application to IIS, as you already know each application get assigned to an Application Pool. Each application pool has a recycle interval.
InetMgr-> Application Pools -> [your application pool ] -> Advanced Settings

When the application pool execution time exceeds its configured recycle time interval application pools get recycled. When a application pool get recycled all the temporary classes which represents aspx pages need to be recreated and also all the application need re-initialize. This process may cause your uses experience long time delays for the first request to the server.
Application Pool ideal timeout.
Application Pool has ideal timeout, which means if there are no requests to the application pool for a time greater than ideal timeout IIS shutdown the Application Pool to free up resources. Zero means no timeout. So if you experience delays due to ideal timeout, you can disable ideal timeout by setting value to zero. But most of the shared hosts have this value configured to maximize the efficiency of resource utilization.
netMgr-> Application Pools -> [your application pool ] -> Advanced Settings

With asp.net 4.0
When you redeploy the site, it is inevitable for the first request it takes time as application need to re-initialize. Fortunately in Asp.net 4.0 there is a option to wake up an application immediately after you deploy the application.
<applicationpools>
  <add name="MyApplicationPool" startMode="AlwaysRunning" />
</applicationpools>
Please see this section for more information.

1 comment:

Ludmal de silva said...

You may also want to read my article about ASP.NET 4.0 features-- http://www.simple-talk.com/dotnet/asp.net/asp.net-4.0-features/

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...