Simple Performance question

A

Andrew Jocelyn

Hi

I have a simple ASP.NET web page with a single label control:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb"
Inherits="proj.TheTime" EnableViewState="false" EnableSessionState="false"%>
....
<p>
<asp:label id="Label1" runat="server">Label</asp:label></p>
....

The code behind file is compiled and contains:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Label1.Text = DateTime.Now.ToString
End Sub

I understand that the first time the web page is requested it is compiled
but it appears to be doing this every few hours. i.e. the first time takes a
couple of seconds then it refreshes very quickly. After a few hours it seems
to take the same amount of time as the first time. When I turn tracing on
(debug is off) I can see that the initial time is 0.110125 to finish page
rendering and subsequent times are about 0.000351.

This happens on 2 separate Windows 2003 Servers. I can't find anything in
the documentation about this. Can someone please let me know what I need to
do to stop the page recompiling itself so often? (If that's what it's doing)

Thanks
Andrew
 
K

Karl

Andrew,
A possibility is that the ASP.Net worker process (aspnet_wp.exe) is
recycling itself. There are a number of reasons why this happens.

Open up your machine.config file, located in
C:\windows\Microsoft.NET\Framework\v1.1.4322\CONFIG\

do a search for <processModel you'll see a number of settings which can
cause a recycle (read the comments about the node). for example:
memoryLimit="[number]" - Represents percentage of physical memory process is
allowed to use before process is recycled

Karl
 
A

Andrew Jocelyn

Hi Karl

Thanks for the pointers so far. I checked the memoryLimit which is set to 60
but I found this note in the machine.config file. Does it apply to me? I am
running IIS6 in the default mode.

"When ASP.NET is running under IIS 6 in native mode, the IIS 6 process model
is used and settings in this section are ignored."

Incidentally I checked the web application pool settings and noticed that
under the performance tab, there is an idle timeout setting of 20 minutes to
shut down the worker process. Could that be anything to do with my problem?
This is the only .NET web page I have running on the server so maybe the
inactivity is causing this?

It's quite scary that a web page which simply tells the time can take 5-10
seconds to display every 5th or so time it's called. What will happen when I
have 2 ASP.NET web pages running on the same server? How much memory and
CPUs I'm I going to need? (Sorry for the sarcasm but it's been bothering me
somewhat.)

Thanks again for your help.
Andrew


Karl said:
Andrew,
A possibility is that the ASP.Net worker process (aspnet_wp.exe) is
recycling itself. There are a number of reasons why this happens.

Open up your machine.config file, located in
C:\windows\Microsoft.NET\Framework\v1.1.4322\CONFIG\

do a search for <processModel you'll see a number of settings which can
cause a recycle (read the comments about the node). for example:
memoryLimit="[number]" - Represents percentage of physical memory process is
allowed to use before process is recycled

Karl

Hi

I have a simple ASP.NET web page with a single label control:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb"
Inherits="proj.TheTime" EnableViewState="false" EnableSessionState="false"%>
...
<p>
<asp:label id="Label1" runat="server">Label</asp:label></p>
...

The code behind file is compiled and contains:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Label1.Text = DateTime.Now.ToString
End Sub

I understand that the first time the web page is requested it is compiled
but it appears to be doing this every few hours. i.e. the first time
takes
a
couple of seconds then it refreshes very quickly. After a few hours it seems
to take the same amount of time as the first time. When I turn tracing on
(debug is off) I can see that the initial time is 0.110125 to finish page
rendering and subsequent times are about 0.000351.

This happens on 2 separate Windows 2003 Servers. I can't find anything in
the documentation about this. Can someone please let me know what I need to
do to stop the page recompiling itself so often? (If that's what it's doing)

Thanks
Andrew
 
K

Karl

Andrew,
You should definitely play with those settings. From the brief explanation
you've given me, the idle time could definitely be the issue. I don't have
enough IIS 6.0 experience to answer your question definitively. I know
that in the properties of your application pool, there are a handful of
setting for worker process recycling ...this is only the case if you aren't
in IIS 5.0 compatible mode...also, if this is the case, your worker process
will be named w3svc.exe

There's a counter you can add to your machine to see if the worker process
is indeed recycling itself. That would at least give you an idea if that's
what the cause is. It's under "ASP.Net" --> "Worker process Restarts".

Finally, in asp.net 2.0, you'll be able to pre-compile everything, so worker
process recycling will hopefully not be as noticeable.

Karl

Andrew Jocelyn said:
Hi Karl

Thanks for the pointers so far. I checked the memoryLimit which is set to 60
but I found this note in the machine.config file. Does it apply to me? I am
running IIS6 in the default mode.

"When ASP.NET is running under IIS 6 in native mode, the IIS 6 process model
is used and settings in this section are ignored."

Incidentally I checked the web application pool settings and noticed that
under the performance tab, there is an idle timeout setting of 20 minutes to
shut down the worker process. Could that be anything to do with my problem?
This is the only .NET web page I have running on the server so maybe the
inactivity is causing this?

It's quite scary that a web page which simply tells the time can take 5-10
seconds to display every 5th or so time it's called. What will happen when I
have 2 ASP.NET web pages running on the same server? How much memory and
CPUs I'm I going to need? (Sorry for the sarcasm but it's been bothering me
somewhat.)

Thanks again for your help.
Andrew


Karl said:
Andrew,
A possibility is that the ASP.Net worker process (aspnet_wp.exe) is
recycling itself. There are a number of reasons why this happens.

Open up your machine.config file, located in
C:\windows\Microsoft.NET\Framework\v1.1.4322\CONFIG\

do a search for <processModel you'll see a number of settings which can
cause a recycle (read the comments about the node). for example:
memoryLimit="[number]" - Represents percentage of physical memory
process
is
allowed to use before process is recycled

Karl

takes need
to
 

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

Top