slow page rendering (prerender event)

W

wardy

Hi, I'm hoping someone can lend me a hand....I've got a .NET Web app
running on Windows 2000 IIS 5.0 linking to a SQL Server 2000 database.
When the database is located on the same server as the web app, the
pages render quickly - however, when I run the app with the database
on its own server, the page rendering takes anywhere from 5-8 seconds,
and when I enable tracing on the application, it appears to be the
begin prerender event that takes up the most time (every other event
is taking in the 0.00XX second range).

Does anyone know what happens in this event and what might be causing
the slow down? Do db connections get made in this event, because that
might explain why moving the db off to another server causes a
performance hit.

Thanks
 
M

Marina

Did you put database code in that event? If you didn't put it there, then
there is no way for it to get there on its own.
 
J

John Saunders

wardy said:
Hi, I'm hoping someone can lend me a hand....I've got a .NET Web app
running on Windows 2000 IIS 5.0 linking to a SQL Server 2000 database.
When the database is located on the same server as the web app, the
pages render quickly - however, when I run the app with the database
on its own server, the page rendering takes anywhere from 5-8 seconds,
and when I enable tracing on the application, it appears to be the
begin prerender event that takes up the most time (every other event
is taking in the 0.00XX second range).

There isn't actually a "begin prerender" event, only a PreRender event.

Could you post the part of the trace where you feel the delay is taking
place?
 
J

John Ward

Thanks for the replies....I don't have any database connections defined
in the pre-render event of any of the pages - all of the database
connections take place in objects, not the aspx pages.

As for the trace, I have posted it below....notice the prerender takes
3.3 secs...This process only takes 0.0xx secs when the db is on the same
server - this may possibly a network issue also, but I am just trying to
eliminate coding issues.

Thanks again

-------------------------------------
Request Details
Session Id: 0a4yll55iwkrt3byoon3c245 Request Type: GET
Time of Request: 16/06/2004 6:47:02 PM Status Code: 200
Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin Init
aspx.page End Init 0.000175 0.000175
aspx.page Begin PreRender 3.300890 3.300715
aspx.page End PreRender 3.300977 0.000087
aspx.page Begin SaveViewState 3.302034 0.001057
aspx.page End SaveViewState 3.302086 0.000052
aspx.page Begin Render 3.302121 0.000035
aspx.page End Render 3.448888 0.146767
Control Tree
Control Id Type Render Size Bytes (including children) Viewstate Size
Bytes (excluding children)
__PAGE ASP.iCat_aspx 9159 0
literalTitle System.Web.UI.WebControls.Literal 26 64
litHeader System.Web.UI.WebControls.Literal 536 780
litLeftMenu System.Web.UI.WebControls.Literal 571 844
litMain System.Web.UI.WebControls.Literal 6673 9508
litFooter System.Web.UI.WebControls.Literal 339 500
Session state
Session Key Type Value
crumb System.Boolean True
cookiesEnabled System.Boolean True
 
J

John Saunders

John Ward said:
Thanks for the replies....I don't have any database connections defined
in the pre-render event of any of the pages - all of the database
connections take place in objects, not the aspx pages.

As for the trace, I have posted it below....notice the prerender takes
3.3 secs...This process only takes 0.0xx secs when the db is on the same
server - this may possibly a network issue also, but I am just trying to
eliminate coding issues.

Thanks again

-------------------------------------
Request Details
Session Id: 0a4yll55iwkrt3byoon3c245 Request Type: GET
Time of Request: 16/06/2004 6:47:02 PM Status Code: 200
Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin Init
aspx.page End Init 0.000175 0.000175
aspx.page Begin PreRender 3.300890 3.300715

No. This shows that the time between "End Init" and "Begin PreRender" is 3.3
seconds.

You should override each of the various methods like OnLoad and add a
Trace.Write to each (be sure to call the base class method at the end). This
will show you where the time is being spent. At a guess, it's in Page_Load.
 
J

John Ward

Hi John, thanks for the suggestion....I'm pretty much a newbie when it
comes to using the trace features. What do you mean by reference the
base class method at the end? Could you provide me an example of how
the code would look to do this?

Thanks again...


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
J

John Saunders

John Ward said:
Hi John, thanks for the suggestion....I'm pretty much a newbie when it
comes to using the trace features. What do you mean by reference the
base class method at the end? Could you provide me an example of how
the code would look to do this?

I forgot whether you use C# or VB.NET, so here's both:

protected override void OnLoad(EventArgs e)
{
Trace.Write(String.Format("OnLoad started at {0}", DateTime.Now);
base.OnLoad(e);
Trace.Write(String.Format("OnLoad ended at {0}", DateTime.Now);
}

Protected Overrides Sub OnLoad(e As EventArgs)
Trace.Write(String.Format("OnLoad started at {0}", DateTime.Now)
MyBase.OnLoad(e)
Trace.Write(String.Format("OnLoad ended at {0}", DateTime.Now)
End Sub
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top