slow page rendering (prerender event)

Discussion in 'ASP .Net' started by wardy, Jun 14, 2004.

  1. wardy

    wardy Guest

    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
     
    wardy, Jun 14, 2004
    #1
    1. Advertising

  2. wardy

    Marina Guest

    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.

    "wardy" <> wrote in message
    news:...
    > 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
     
    Marina, Jun 14, 2004
    #2
    1. Advertising

  3. "wardy" <> wrote in message
    news:...
    > 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?
    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Jun 15, 2004
    #3
  4. wardy

    John Ward Guest

    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

    -----------------------------------------------------


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    John Ward, Jun 16, 2004
    #4
  5. "John Ward" <> wrote in message
    news:%23TQai%23%...
    > 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.
    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Jun 17, 2004
    #5
  6. wardy

    John Ward Guest

    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!
     
    John Ward, Jun 17, 2004
    #6
  7. "John Ward" <> wrote in message
    news:%...
    > 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
    --
    John Saunders
    johnwsaundersiii at hotmail
     
    John Saunders, Jun 18, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWxpcmV6YSBaaWFp?=

    PreRender Event occurs immediatley after Load event

    =?Utf-8?B?QWxpcmV6YSBaaWFp?=, Feb 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,118
    Hans Kesting
    Feb 9, 2004
  2. Jimmy
    Replies:
    5
    Views:
    15,309
    =?Utf-8?B?Sm9yZ2UgTCBNYXRvcyBbTUNTRC5ORVRd?=
    Apr 27, 2005
  3. Selden McCabe

    How to determine page ID on Prerender event?

    Selden McCabe, May 3, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    485
    Selden McCabe
    May 3, 2005
  4. Mariella Bakker
    Replies:
    1
    Views:
    5,229
    John Timney \( MVP \)
    May 8, 2006
  5. Bjarke
    Replies:
    5
    Views:
    3,541
    Bjarke
    Sep 18, 2007
Loading...

Share This Page