tags:

views:

1972

answers:

11

The first time I load the website in the production web server, it start very slow, subsequent pages load very quickly (included the home page).

I precompiled the site, but nothing changes.

I don't have any code at Application start. I don't have cached items.

Any ideas? How can I find out what is happening?

A: 

This sounds very much like background compiling; though if you're precompiling, that shouldn't be an issue.

First thing I would look at is your ORM (if any). NHibernate, in particular, has a serious startup penalty, as it runs multiple compilers in the background at startup to turn each class in your data layer into its own in-memory assembly.

DannySmurf
+1  A: 

When you published the site, did you choose to make the website "updatable" in the publish website's settings or not? If I remember well, the aspx / ascx file need to be compiled as well, and if they are "updatable" then the first start will cause a recompile of those resources.

ila
+1  A: 

Have you turned on tracing in your web.config?

Mickey
+4  A: 

It's just your app domain loading up and loading any binaries into memory. Also, it's initializing static variables, so if you have a static variable that loads up a lot of data from the db, it might take a bit.

Darren Kopp
A: 

Just a quick nod at Darren. That's typical behavior of a .NET app after a DLL update is made. After the initial load everything should zip along just fine.

Dillie-O
A: 

When you say "precompile" the site, are you using the aspnet_compiler utility to precompile, or simply using the "Build site" option in Visual Studio?

If you are not carrying out the former, I recommend giving it a spin. Coupled with Web Deployment Projects, you should have an easier time deploying your site for each release.

icelava
A: 

The initial slowness is a couple things:

  • The appDomain is being setup
  • ASP.NET is parsing and compiling the ASPX pages.
  • Global Contexts are being initialized.

This is normal behavior for ASP.NET.

FlySwat
A: 

@ila: no, the website is not updatable

@Mickey: No, it is turned off. Do I need to turn it on to find out?

@icelava: I'm using Web Deployment Project

@Jonathan Holland: Maybe is normal, but I want to be sure

Eduardo Molteni
A: 

@Mickey: No, it is turned off. Do I need to turn it on to find out?

The trace log will show you how long each action takes. It could help you find what is taking so long.

Here is a link that might help you get it setup.

Mickey
A: 

Try clearing your event log?

A: 

use http://www.iis.net/expand/ApplicationWarmUp for warming up your app this is for IIS 7.5 - so if you are running on Server R2 then it will work.

ashish jaiman