First hit on site is very very slow after sessions time out

E

Earl Teigrob

The first time any of my web apps are hit, they take a long time (45
seconds) for the JIT compiler to compile them. After being hit the first
time, they are very fast. My boss is starting to think that .NET is crap
because every time he goes to hit the Intranet, it takes so long to compile
the code. I am running the apps on a windows 2003 server, which appears to
dump cached code very promptly after 20 minutes of inactivity (when all the
user sessions time out). For some reason, it seems like Windows 2000 holds
on the cache for a much longer period of time then Windows 2003???(Based on
practical experience, not any conclusive tests) Please do not blame the code
on this...I have experimented and read enough to know better.(Note: We
should be writing code to run fast, NOT COMPILE FAST, Hello!!!) I need a
way to tell the server to hold on to the code cache until there is a change
in the code or, of course, IIS or the server is restarted... And, if this is
not possible, I would hope that Microsoft makes addressing this issue a
priority.



Thanks for your help



Earl
 
C

Chad Z. Hower aka Kudzu

Earl Teigrob said:
The first time any of my web apps are hit, they take a long time (45
seconds) for the JIT compiler to compile them. After being hit the first
time, they are very fast. My boss is starting to think that .NET is crap

Im not that familiar with NGEn, but if I understand what it does, you can run
Ngen on them to pre "JIT" them.


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"


ELKNews - Get your free copy at http://www.atozedsoftware.com
 
E

Earl Teigrob

Ive heard that NGEn creates very inefficient, unoptimized code...but then
compared to what? (JIT code, obviously , but in my case I am comparing it to
a 45 second page load) If it takes my 45 seconds JIT compile time and loads
a page in, lets say, 2 seconds every time, who cares if it could have loaded
in 1.5 seconds after the first compile in a more optimized form? Anyone have
ideas on this?

Earl
 
C

Chad Z. Hower aka Kudzu

Earl Teigrob said:
Ive heard that NGEn creates very inefficient, unoptimized code...but
then compared to what? (JIT code, obviously , but in my case I am
comparing it to a 45 second page load) If it takes my 45 seconds JIT
compile time and loads a page in, lets say, 2 seconds every time, who
cares if it could have loaded in 1.5 seconds after the first compile in
a more optimized form? Anyone have ideas on this?

Exactly. Another option is that after each deploy, you could just access the
app once you self to compile it no? Then when your boss accesses it its all
ready to go.
 
E

Earl Teigrob

First of all my boss gets to work before I do...no comment.
And I would have to hit the site every 15 minutes all day so that it would
always be compiled...not going to happen
I really think that Microsoft need to address this issue to come up with the
real (proper) solution...

Earl
 
C

Chad Z. Hower aka Kudzu

Earl Teigrob said:
First of all my boss gets to work before I do...no comment.

But you are there when you update the site though no?
And I would have to hit the site every 15 minutes all day so that it
would always be compiled...not going to happen
I really think that Microsoft need to address this issue to come up with
the real (proper) solution...

Are you updating the source files on the site every 15 minutes?
 
E

Earl Teigrob

Did I mention that the code is flushed from cache after all the user
sessions time out...(see subject)...so to keep a user session active, I
would have to hit the page before the 20 minute session has expired... Earl
 
S

Scott M.

What you are describing is the designed behavior of .NET pages with one
exception.

Yes, pages will take a bit longer the first time they are accessed as the
JIT compiler creates a temporary class for the page and places that file in:
C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files.

HOWEVER, it is NOT normal behavior for these files to be flushed after all
sessions time out. The temporary class(es) will stay there as long as the
class(es) don't undergo any changes and therefore have new versions of them
deployed on the web server. So, If I have a webserver that hasn't had any
changes made to it's assembly in a day, a month or a year, the temporary
assembly will stay in place for that long as well.

You should check the timestamp of these files to verify that they are, in
fact, re-generating every so often without cause and if they are doing this,
I would look at your IIS settings to see if IIS is somehow resetting itself
and therefore causing all the temporary classes to have to regenerate.



Earl Teigrob said:
Did I mention that the code is flushed from cache after all the user
sessions time out...(see subject)...so to keep a user session active, I
would have to hit the page before the 20 minute session has expired... Earl
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top