Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a really annoying problem.
I have an application (.net 3.5) running within IIS7.5.
Normally when I recycle an application it takes some time the first time you surf to the application. I'm used to this behaviour so I don't mind. I think that IIS then caches the dll's needed within the application, no?
Well I have one application that runs on IIS7.5 that doesn't show this behaviour. In fact when I recycle my application the first page loads really really fast (less than a second). So does every page in the application, except for one.
After some research (about 2 days) I've found that it is due to one particulary 3rd party dll that appearantly doesn't get cached on the first load of the application. So the first time I surf to this particulary page that dll (17 mb big) is loaded, which off course takes some time (the time usually needed on first load). After this first time that page is going really fast, it's really the loading of that dll that causes the performance issue.

How can I make IIS 7.5 load all my dll's on application start?

I hope I explained it well.

To know:

  • Windows server 2008 (64 bit)
  • IIS 7.5
  • .NET 3.5
  • Virtual environment

Cheers, M.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

.NET loads dll's (or assemblies as they are more usually know) lazily. Only when something that needs an assembly is about to be executed will the assembly be loaded.

Thus if the assembly is never needed, because nothing that uses it is called, it never needs to be loaded.

share|improve this answer
1  
@SemDendoncker: it depends on the dll. Maybe it does something slow on load (timeout waiting on some resource?), or maybe need has a lot of fixups if relocated (i.e. no loaded at its preferred load address in memory)... Best answer: Talk to the developer, with a re-create sample to hand. Without knowing the implementation and details of the case (e.g. profiling, ProcMon, code review...) it is all guesses. –  Richard Aug 26 '10 at 9:08
    
Thx richard, you're the best!! –  user29964 Aug 26 '10 at 10:44
2  
@Lieven: There is a solution (I didn't include this because I assumed it was obvious): reference the dll from somewhere that will lead it to be loaded earlier in the application lifecycle (e.g. Application_Start hander). –  Richard Sep 20 '10 at 8:29
1  
Indeed, but starting the application will taken long then, I guess. Could the problem be that the third party dlls aren't that good (architectural, ...)? –  Lieven Cardoen Sep 21 '10 at 6:44
1  
@Lieven: Yes, a dll that takes a significant time to load is a problem. I would look at perhaps rebasing it (to avoid the Windows loader needing to read and apply relocations (meaning the whole dll has to be read) rather than using its preferred base address (thus is just demand paged directly). With ASP.NET allowing many apps per worker finding a consistently free address might be a problem. –  Richard Sep 21 '10 at 10:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.