Slow Response for ASP.NET page

  • Thread starter Ramkumar T via DotNetMonster.com
  • Start date
R

Ramkumar T via DotNetMonster.com

Hi
I am experiencing performance issues with my simple web application. (which
contains pretty simple and straight forward web pages).The app's home page
takes well over 15 seconds to run under ASP.NET for the first time. Well I
agree that the initial page load takes a while becos of the JIT compilation.

However,after first load the delay goes away, but it returns after some idle
time.

Any Suggestions so as to improve the performance?

Please help!
 
M

Mark Fitzpatrick

This is exactly how it should be. After a period of idle time the web server
is recovering unused resources including the compiled ASP.Net code. This is
just part of the garbage collection and memory management of the web server
and helps to keep the web server healthy. It should take about 20 minutes
after the last page request before the web server unloads the application.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
L

Lucas Tam

This is exactly how it should be. After a period of idle time the web
server is recovering unused resources including the compiled ASP.Net
code. This is just part of the garbage collection and memory
management of the web server and helps to keep the web server healthy.
It should take about 20 minutes after the last page request before the
web server unloads the application.

Too bad the server can't keep an application alive without any hacks : (
 
B

Ben

Would you really want to run an application that isn't being used? Remeber
for a web application all static and cache items etc are retained in
physical memory. The server simply says, hey my last session has timed out,
I'm not being used, so I'll shut down for memory conservations sake. I do
think it would be cool to have a flag somewhere at the application level to
indicate that you want to keep the application running at all times.

HTH,
Ben
 
J

JIMCO Software

Ramkumar said:
Hi
I am experiencing performance issues with my simple web application.
(which contains pretty simple and straight forward web pages).The
app's home page takes well over 15 seconds to run under ASP.NET for
the first time. Well I agree that the initial page load takes a
while becos of the JIT compilation.

I would check your processmodel or app pool settings. It sounds to me like
one of two things is happening:

1. Your app domain is recycling.
2. The process is recycling.

Either one of these will cause the behavior that you describe. It's
important to realize that once an assembly is loaded into your app domain,
it will not be unloaded until the app domain recycles. Therefore, this
issue has nothing to do with resources being reclaimed by GC. That will not
affect what you are seeing.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 
L

Lucas Tam

Would you really want to run an application that isn't being used?

Some applications are used only during business hours... or perhaps
they're low-usage. This does not mean the application is not used, just
not continiously.

Thus, when the application is uncached, the user has to wait a long
period of time to wait for the applicaiton to be started.

It would be nice if Microsoft allowed the application to remain in
memory (i.e. Force Keep Alive).
The server simply says, hey my last
session has timed out, I'm not being used, so I'll shut down for
memory conservations sake. I do think it would be cool to have a flag
somewhere at the application level to indicate that you want to keep
the application running at all times.

Why not? Memory is cheap. Hardware is cheap. And if the administrator
wants the app to stay alive, what's wrong with that?
 
J

JIMCO Software

Lucas said:
Why not? Memory is cheap. Hardware is cheap. And if the administrator
wants the app to stay alive, what's wrong with that?


Lucas,

The problem here is that you've been given some false information.
Depending on the OS, there are settings that control this.

In IIS 5.0, the processModel element has an idleTimeout setting (defaults to
infinite) that specifies how long the worker process can be idle (no
requests) before it is shut down. If you're on IIS 5, check that.

In IIS 6.0, the app pool has several settings that can cause the application
to unload. On the Recycling tab, you can configure how the process is
recycled. There is also a setting on the Performance tab that will recycle
after 20 (default) minutes of inactivity. (This setting is the equivalent
to the idleTimeout on IIS 5.

The important point to remember is that what causes reJITting is when the
application domain unloads. That causes the JITted assemblies to unload
from the process. (Of course, the process shutting down causes the same
issue.) Anytime the JITted assemblies are unloaded, you will have to incur
the cost of JIT compilation again the next time the app is hit.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 
L

Lucas Tam

The problem here is that you've been given some false information.
Depending on the OS, there are settings that control this.

In IIS 5.0, the processModel element has an idleTimeout setting
(defaults to infinite) that specifies how long the worker process can
be idle (no requests) before it is shut down. If you're on IIS 5,
check that.

In IIS 6.0, the app pool has several settings that can cause the
application to unload. On the Recycling tab, you can configure how
the process is recycled. There is also a setting on the Performance
tab that will recycle after 20 (default) minutes of inactivity. (This
setting is the equivalent to the idleTimeout on IIS 5.

Thank you for this info! I'm going to take a closer look at it to see if it
solves my problem.

Thank you : )
 
B

Ben

Jim,

That's very interesting information. I didn't realize the setting was at
the application pool level. This leaves me wondering (strictly curious, I
personally never use sessions), what happens to sessions that are set to
expire after the application pool recycle time?

E.g. Session Timeout = 60 (just hypothetical) & App pool recycle = 20

20 minutes go by, the app pool is recycled, 20 more minutes go by, (we're at
40 minutes since the last request), the user sends a request. What happens
now? The application is started up? This seems to indicate that since the
application went down any session state was lost. Seems like bad things
could happen because of this.

Am I missing something? Are we supposed to configure application pool
recycling to coinside with their application session timeouts? Ouch!

Ben
 
J

JIMCO Software

Ben said:
Jim,

That's very interesting information. I didn't realize the setting
was at the application pool level. This leaves me wondering
(strictly curious, I personally never use sessions), what happens to
sessions that are set to expire after the application pool recycle
time?
E.g. Session Timeout = 60 (just hypothetical) & App pool recycle = 20

20 minutes go by, the app pool is recycled, 20 more minutes go by,
(we're at 40 minutes since the last request), the user sends a
request. What happens now? The application is started up? This
seems to indicate that since the application went down any session
state was lost. Seems like bad things could happen because of this.

Am I missing something? Are we supposed to configure application pool
recycling to coinside with their application session timeouts? Ouch!

Hi Ben,

The default (on Windows Server 2003) is a recycle after 20 minutes of
inactivity. If there are active Sessions, you don't have inactivity.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 
B

Ben

I knew I was missing something. Thanks.

JIMCO Software said:
Hi Ben,

The default (on Windows Server 2003) is a recycle after 20 minutes of
inactivity. If there are active Sessions, you don't have inactivity.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003
 
Joined
Nov 13, 2007
Messages
4
Reaction score
0
.net slow response

I had the same problem. The reason is that the application domain times out every 20 mins if there is no activity, the first request after the timeout can force a recompile and reload of cache. Changing some settings in the machine.config file will solve the problem; unfortunately for me my hosting provider would not allow me to make this change. I found this utility to be useful.

http://www.spikesolutions.net/ViewSolution.aspx?ID=c2b7edc0-5de1-4064-a432-05f6eded3b82

Essentially it "Pings" my home page every few mins so the application domain does not time out. The utility can also be configured to ping more than one page so that auxiliary pages are fast too.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top