Any way to make pages faster?

T

Terry Olsen

Is there any way to make my aspx pages appear faster on the first hit? When
browse to a page I have on my local server, I watch the server's hard drive
light chug away for a good 20-30 seconds before anything appears in my
browser. I would be surprised if I'm not having some would-be web site
visitor move on thinking the site is dead.

Once the first hit has activated the site, it all responds fairly
quickly...that is until the next time the site has been idle for a while...
 
K

Kevin Spencer

The delay is caused by the Application starting. The Application will time
out after a period of time (I believe 20 minutes by default) with no
requests. You can configure the timeout for the Application, and this will
be less harmful in terms of freeing up memory resources than, for example,
configuring your Sessions to time out. However, be aware that once your site
starts getting any traffic, this problem is very unlikely to occur.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.
 
B

Brock Allen

ngen is a red herring -- Kevin was correct in that the majority of time is
the application starting (not the page compilation).




Maybe ngen [1] huh? There's many articles that can be found discussing
what has been learned about maximizing ASP.NET performance.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptoo
ls/html/cpgrfnativeimagegeneratorngenexe.asp

Is there any way to make my aspx pages appear faster on the first
hit? When browse to a page I have on my local server, I watch the
server's hard drive light chug away for a good 20-30 seconds before
anything appears in my browser. I would be surprised if I'm not
having some would-be web site visitor move on thinking the site is
dead.

Once the first hit has activated the site, it all responds fairly
quickly...that is until the next time the site has been idle for a
while...
 
C

clintonG

I haven't implemented any particular methodology yet myself but I have seen
many articles and proposed solutions such as a control that pinged the
server to keep the application state refreshed. What aspect of ngen has
proven fallible? What solution(s) have you found meritorious?

<%= Clinton Gallagher



Brock Allen said:
ngen is a red herring -- Kevin was correct in that the majority of time is
the application starting (not the page compilation).




Maybe ngen [1] huh? There's many articles that can be found discussing
what has been learned about maximizing ASP.NET performance.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptoo
ls/html/cpgrfnativeimagegeneratorngenexe.asp

Is there any way to make my aspx pages appear faster on the first
hit? When browse to a page I have on my local server, I watch the
server's hard drive light chug away for a good 20-30 seconds before
anything appears in my browser. I would be surprised if I'm not
having some would-be web site visitor move on thinking the site is
dead.

Once the first hit has activated the site, it all responds fairly
quickly...that is until the next time the site has been idle for a
while...
 
B

Brock Allen

Well, like I said, the slow response upon the first request is just part
of how ASP.NET works. I see it as the cost of doing business. The JIting
is a small part of that, but only happens once ever (assuming the pages don't
change) whereas the cost of starting the AppDomain ocurrs every time the
app starts.

As far as ngen, the downsides, IMO, outweigh the upsides. It's an extra step
to perform. Once an assembly is ngen'd, the code is very brittle -- if any
assembly in the dependency tree is changed, then the entire ngen tree is
invalidated and the JITter kicks back in as normal ignoring the ngen'd assemblies.
This makes updating a single assembly more difficult. Also, when using ngen,
you now have two images of your assembly loaded -- the NGen'd one (with the
x86) but you also need to load the original one, since that's where all the
metadata is. Lastly, with the x86 code you're guarenteed the entire things
is loaded, whereas with JITing only the code you call is actually JIT'd.

NGEN was originally intended to avoid the lag one *might* see with windows
forms apps starting due to the JITing. Too often people assumed it was JITing
that was causing their app to be slow -- they would often overlook the numerous
DB round trips as a possible performance problem. ;)

NGEN in 2.0 does get better, but I'm still not convinced it's worth it for
for server based apps like ASP.NET.




I haven't implemented any particular methodology yet myself but I have
seen many articles and proposed solutions such as a control that
pinged the server to keep the application state refreshed. What aspect
of ngen has proven fallible? What solution(s) have you found
meritorious?

<%= Clinton Gallagher

ngen is a red herring -- Kevin was correct in that the majority of
time is the application starting (not the page compilation).

Maybe ngen [1] huh? There's many articles that can be found
discussing what has been learned about maximizing ASP.NET
performance.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpt
oo
ls/html/cpgrfnativeimagegeneratorngenexe.asp

Is there any way to make my aspx pages appear faster on the first
hit? When browse to a page I have on my local server, I watch the
server's hard drive light chug away for a good 20-30 seconds before
anything appears in my browser. I would be surprised if I'm not
having some would-be web site visitor move on thinking the site is
dead.

Once the first hit has activated the site, it all responds fairly
quickly...that is until the next time the site has been idle for a
while...
 
C

clintonG

I see. Brittle is not good unless it has peanut butter in it :)

<%= Clinton Gallagher

Brock Allen said:
Well, like I said, the slow response upon the first request is just part
of how ASP.NET works. I see it as the cost of doing business. The JIting
is a small part of that, but only happens once ever (assuming the pages
don't change) whereas the cost of starting the AppDomain ocurrs every time
the app starts.

As far as ngen, the downsides, IMO, outweigh the upsides. It's an extra
step to perform. Once an assembly is ngen'd, the code is very brittle --
if any assembly in the dependency tree is changed, then the entire ngen
tree is invalidated and the JITter kicks back in as normal ignoring the
ngen'd assemblies. This makes updating a single assembly more difficult.
Also, when using ngen, you now have two images of your assembly loaded --
the NGen'd one (with the x86) but you also need to load the original one,
since that's where all the metadata is. Lastly, with the x86 code you're
guarenteed the entire things is loaded, whereas with JITing only the code
you call is actually JIT'd.
NGEN was originally intended to avoid the lag one *might* see with windows
forms apps starting due to the JITing. Too often people assumed it was
JITing that was causing their app to be slow -- they would often overlook
the numerous DB round trips as a possible performance problem. ;)

NGEN in 2.0 does get better, but I'm still not convinced it's worth it for
for server based apps like ASP.NET.




I haven't implemented any particular methodology yet myself but I have
seen many articles and proposed solutions such as a control that
pinged the server to keep the application state refreshed. What aspect
of ngen has proven fallible? What solution(s) have you found
meritorious?

<%= Clinton Gallagher

ngen is a red herring -- Kevin was correct in that the majority of
time is the application starting (not the page compilation).


Maybe ngen [1] huh? There's many articles that can be found
discussing what has been learned about maximizing ASP.NET
performance.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpt
oo
ls/html/cpgrfnativeimagegeneratorngenexe.asp

Is there any way to make my aspx pages appear faster on the first
hit? When browse to a page I have on my local server, I watch the
server's hard drive light chug away for a good 20-30 seconds before
anything appears in my browser. I would be surprised if I'm not
having some would-be web site visitor move on thinking the site is
dead.

Once the first hit has activated the site, it all responds fairly
quickly...that is until the next time the site has been idle for a
while...
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top