Slow Rendering Page on First Access

W

Wannabe

I have a page that take 10-15 seconds to load up the first time you access
it. Once the page loads, it runs super quick, but that initial hit (like
after an hour if no one has hit the page) takes a long time to come up.

Just to rule out databases, and any other external thing I could think of, I
tried creating a website that had nothing but one page. On that page, I put a
label that displayed the time when accessed. This page did exactly the same
thing as above.

Anyone got any suggestions on what I can try?
 
G

George Ter-Saakov

First time you hit your application your application is compiled and
Application_Init runs..
So depends on how big it is and how time consuming your Application_Init is
the delay is expected.

Also after some period of inactivity your application is unloaded. Hence if
will be recompiled and Init run again next time you hit it.


To speed things up you can do following....

1. Precompiled it. (if you using .NET 2.0) Google it up how to do it.
2. Disable unloading.... You need to have access to IIS management console
and go into the Pools under "IIS" tree.. There will be an option there...


George.
 
W

Wannabe

Thanks for the advice, but I have one question...

We have another server that our web apps do not do this, or it is not
noticeable, and we have never precompiled or stopped our apps from unloading.
Is there something else, or would you say that the servers are configured
separately. They are both the same model, speed, memory, etc.

Thanks
 
G

George Ter-Saakov

I would say, double check what you saying...
It's easy to see that application is not precompiled. But it's not that easy
to say that application is unloading or not.

you have to go and check in IIS Management console .NET Pool settings. And
since it's per pool and not application may be someone had set it for
another application and your application is benefiting form it without you
realizing it.

----------------Assuming you verified it and it's how you say it
is-------------
Something slows down your application on one machine and does not do it on
second machine..

My guess would be
1. Antivirus....NET create temp DLLs and with antivirus present it might
want to scan those DLLs before allowing them to be loaded into memory...

2. Different web.config. your machines might have different web.config
settings (debug is on for example) that would make a difference

3. Slow machine vs Fast machine... Even if you have same CPU/memory you
still might have some external processes that eat CPU time on one machine
and does not exist on another machine. Antivirus again is one of the
examples...

George.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top