views:

1082

answers:

4

I have started work at a new company and the main project I work on (an ASP.NET 3.5 Web Application Project) takes an excessively long time to initially load (Around 1.5 minutes)

I am aware that this is generally the nature of web app projects but my issue is this seems way too long.

Ive tried several things to try and pinpoint what might be causing this lag including Replacing the web.config with a fresh one created from a new project cleared everything from my app_start in my web.config deleted all weppart dlls from my bin folder (which leaves me with 19 dlls in my bin directory including 6 from the MS enterprise library)

and still it takes a very long time to load.

I was wondering if anyone had any pointers as to how I may go about finding out what causes such a huge load time or of any tools that would help me see what my app is doing when it starts

thanks -Kris

+2  A: 

Try a warm-up script.

JetBrains DotTrace is an excellent ASP.NET profiler.

Chris Ballance
Thanks Chris but my issue is with working on the project, ie develop code > compile > look at changes - cant really schedule a warm up every 5 minutes
Lightweight
+1 for the DotTrace recommendation - attach that to the site and see what's taking the time to load. Also take a look at the memory usage and processeor utilisation - is it w3wp that's taking all the resources, or something else?
Zhaph - Ben Duguid
Hi Chris, I must be blind, i didnt see the second line mentioning DotTrace, thanks
Lightweight
A: 

How many projects are there? If you have heaps of assemblies and dlls in the bin directory, that can slow load times considerably (even if they are quite small). That's the best I can suggest.

Travis
There are 8 other projects which doesnt seem that bad to me. there are a lot of web part dlls, thats why i tried deleting them all and testing the load time after that but still no joy :(
Lightweight
A: 

Try using the SQL Profiler and watch the associated database activity during startup.

Chances are, there's a load of queries hitting the database on the first page view to initialize the various caches.

If that is the case, you could focus your effort on optimizing the queries that are causing the most blocking.

richardtallent
+1  A: 

There is another gotcha in .NET 2.0 onwards. If you have any signed assemblies in you bin folder, then CLR tries connect to a VeriSign URL and fetches a revocation list of the certificates to see if they are valid.

This could eat up some of your startup time as well. If you think this could be contributing to your problem then you can have a look at the following to MS articles:

http://digital.ni.com/public.nsf/allkb/18E25101F0839C6286256F960061B282
http://support.microsoft.com/kb/936707

To deal with this on a per-application basis you can add the following settings under the config section in your app.config/web.config.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <runtime>
       <generatePublisherEvidence enabled="false" />
    </runtime>
</configuration>

Of course, if you add this setting, the signed DLLs will not be verified for their validity anymore!

Raghu
If this is mainly a problem in development, you can turn it off while developing, and have it turned on in the live app.
awe