Page loads slowly

Rate It (1)

Last post 10-24-2007 5:49 PM by wkcapelle. 7 replies.

Sort Posts:

  • Page loads slowly

    03-03-2007, 7:39 PM
    • Member
      392 point Member
    • megetron
    • Member since 03-13-2006, 9:38 AM
    • Posts 553

    When I first enter the ASP.NET website it displayed very very slow...sometime 30 seconds and more...

    How can I detect teh reason for that?

  • Re: Page loads slowly

    03-03-2007, 8:37 PM
    • All-Star
      37,391 point All-Star
    • Haissam
    • Member since 10-05-2006, 6:25 AM
    • Beirut - Lebanon
    • Posts 5,632

    Try to trace your code by adding a breakpoint at the first line in the page_load event and see which function is taking this time

    for more about tracing, find links below

    Debugging ASP.NET application

    How to debug ASP.NET applications

    HC

    Haissam Abdul Malak
    MCAD.NET
    | Blog |
  • Re: Page loads slowly

    03-03-2007, 8:41 PM
    • Contributor
      3,086 point Contributor
    • Girijesh
    • Member since 10-27-2005, 12:04 PM
    • India
    • Posts 652
    Put Trace="True" into the page diective and see where page takes time.
  • Re: Page loads slowly

    03-03-2007, 9:23 PM
    • Participant
      1,901 point Participant
    • flanakin
    • Member since 10-05-2003, 7:06 PM
    • Washington, DC area
    • Posts 384

    Can you give us more details about your scenario? What server are you running on? What type of project? What compilation options are you using? There are countless factors that go into application performance. For a detailed list of those, check out Improving Application Performance and Scalability.

    Michael Flanakin | Microsoft Consulting Services
    www.michaelflanakin.com
    Filed under:
  • Re: Page loads slowly

    03-04-2007, 12:19 PM
    • Member
      392 point Member
    • megetron
    • Member since 03-13-2006, 9:38 AM
    • Posts 553

    I am running under win server 2003. the project is ASP.NET website. I am using the debug mode, the default settings of compilation modes visual studio 2005.

    Every time I am uploading the application for the first time, from the visual studio, I am getting an error as this:

     

    Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

    Source Error:

    Line 118:    public virtual string Culture {
    Line 119:        get {
    Line 120:            return ((string)(this.GetPropertyValue("Culture")));
    Line 121:        }
    Line 122:        set {

    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\tbh_web\37407c9b\101595b6\App_Code.h2cwnupj.3.cs    Line: 120

    Stack Trace:

    [SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +454
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +512
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
       System.Data.SqlClient.SqlConnection.Open() +162
       System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +89
       System.Data.SqlClient.SqlConnection.Open() +162
       System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
       System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +199
       System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +735
       System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) +430
       System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +410
       System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +112
       System.Configuration.SettingsBase.get_Item(String propertyName) +91
       System.Web.Profile.ProfileBase.GetInternal(String propertyName) +37
       System.Web.Profile.ProfileBase.get_Item(String propertyName) +70
       System.Web.Profile.ProfileGroupBase.GetPropertyValue(String propertyName) +23
       ProfileGroupPreferences.get_Culture() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\tbh_web\37407c9b\101595b6\App_Code.h2cwnupj.3.cs:120
       MB.TheBeerHouse.UI.BasePage.InitializeCulture() in e:\websites\TheBeerHouse\TBH_Web\App_Code\BasePage.cs:19
       ASP.default_aspx.__BuildControlTree(default_aspx __ctrl) in e:\websites\TheBeerHouse\TBH_Web\Default.aspx:1
       ASP.default_aspx.FrameworkInitialize() in e:\websites\TheBeerHouse\TBH_Web\Default.aspx.cs:912307
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +40
       System.Web.UI.Page.ProcessRequest() +85
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +20
       System.Web.UI.Page.ProcessRequest(HttpContext context) +110
       ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\tbh_web\37407c9b\101595b6\App_Web_7ytarovy.0.cs:0
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +317
       System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +199
       System.Web.Management.SqlWebEventProvider.WriteToSQL(WebBaseEventCollection events, Int32 eventsDiscardedByBuffer, DateTime lastNotificationUtc) +728
       System.Web.Management.SqlWebEventProvider.ProcessEvent(WebBaseEvent eventRaised) +172
       System.Web.Management.WebBaseEvent.RaiseInternal(WebBaseEvent eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1) +952
    

     

  • Re: Page loads slowly

    03-04-2007, 1:34 PM
    Answer
    • All-Star
      37,391 point All-Star
    • Haissam
    • Member since 10-05-2006, 6:25 AM
    • Beirut - Lebanon
    • Posts 5,632
  • Re: Page loads slowly

    04-24-2007, 11:27 AM
    • Member
      392 point Member
    • megetron
    • Member since 03-13-2006, 9:38 AM
    • Posts 553

    thanks for all replies.

    I used the trace option. when enter first time to page I am getting bad resultsm and when refreshing the page again trace results are better, and the page really loads quick. I am pasting both results. bad and good one, please let me know what you see the problem is:

    Trace Information

    Category Message From First(s) From Last(s)
    aspx.page Begin PreInit
    aspx.page End PreInit 2.54944199130025 2.549442
    aspx.page Begin Init 2.54963803819891 0.000196
    aspx.page End Init 2.63466905624125 0.085031
    aspx.page Begin InitComplete 2.6348582433359 0.000189
    aspx.page End InitComplete 2.65515699587155 0.020299
    aspx.page Begin PreLoad 2.65535169030885 0.000195
    aspx.page End PreLoad 2.65554979464872 0.000198
    aspx.page Begin Load 2.65570490521699 0.000155
    aspx.page End Load 9.38111448565755 6.725410
    aspx.page Begin LoadComplete 9.38132317719494 0.000209
    aspx.page End LoadComplete 9.38190803798463 0.000585
    aspx.page Begin PreRender 9.38207623067912 0.000168
    aspx.page End PreRender 9.77778374725008 0.395708
    aspx.page Begin PreRenderComplete 9.77821315998114 0.000429
    aspx.page End PreRenderComplete 9.77838039770292 0.000167
    aspx.page Begin SaveState 9.79926498350047 0.020885
    aspx.page End SaveState 9.80063711429673 0.001372
    aspx.page Begin SaveStateComplete 9.80080915188137 0.000172
    aspx.page End SaveStateComplete 9.80100700872832 0.000198
    aspx.page Begin Render 9.8011614643153 0.000154
    aspx.page End Render 9.8222899006457 0.021128

     

    Better results after refreshing page:

    Trace Information

    Category Message From First(s) From Last(s)
    aspx.page Begin PreInit
    aspx.page End PreInit 0.0262800241421674 0.026280
    aspx.page Begin Init 0.0264863707465501 0.000206
    aspx.page End Init 0.0368048684323305 0.010318
    aspx.page Begin InitComplete 0.0370006903374189 0.000196
    aspx.page End InitComplete 0.0558854032741922 0.018885
    aspx.page Begin PreLoad 0.0560848775749264 0.000199
    aspx.page End PreLoad 0.0562758721179395 0.000191
    aspx.page Begin Load 0.0564333576183538 0.000157
    aspx.page End Load 0.789721436530385 0.733288
    aspx.page Begin LoadComplete 0.789914683509043 0.000193
    aspx.page End LoadComplete 0.790495416916659 0.000581
    aspx.page Begin PreRender 0.790663262121082 0.000168
    aspx.page End PreRender 0.966340745264421 0.175677
    aspx.page Begin PreRenderComplete 0.966536674666438 0.000196
    aspx.page End PreRenderComplete 0.966691882731922 0.000155
    aspx.page Begin SaveState 0.99643903031342 0.029747
    aspx.page End SaveState 0.997844775149281 0.001406
    aspx.page Begin SaveStateComplete 0.99803761713951 0.000193
    aspx.page End SaveStateComplete 0.998236653952744 0.000199
    aspx.page Begin Render 0.998397651852804 0.000161
    aspx.page End Render

  • Re: Page loads slowly

    10-24-2007, 5:49 PM
    • Member
      2 point Member
    • wkcapelle
    • Member since 04-13-2006, 6:37 AM
    • Posts 1

    Hi there,

    Did you find the cause of the problem or even better, a solution?

    I understand that if you do not close the connection properly, it does not return to the connectionpool. But i thought this was managed by .net it self.

    Anyone?

Page 1 of 1 (8 items)