locked
Page load speed / bottleneck? RRS feed

  • Question

  • User-1225226813 posted

    Hi all,

    Environment: local hosted IIS server, local hosted SQL server both running on same Vmware box. 

    I have an intranet application ASPX Form that is taking approx 3~4 seconds to load each page.

    When I capture the start time / end time of a page, its telling me its only taking approx 300~500ms to load.

    protected void Page_Load(object sender, EventArgs e) {
    
            DateTime startProcessing = DateTime.Now;
    }

    and at the end of the page code.

       DateTime endprocessing = DateTime.Now;
            var executionTime = startProcessing - endprocessing;
            litExecutionTime.Text = "execution time: " + Math.Round(Convert.ToDecimal((endprocessing - startProcessing).TotalMilliseconds.ToString()),2) + "ms";
    

    Using Chrome, when I hit the page, the page load spinner is grey for about 2 seconds then turns blue for less than a second and displays the results.

    Googling the colours of the gray spinner means that chrome is sending the request and blue is loading the response.

    I'm struggling to find out why its taking so long for the page to load when everything else is telling me its quick.

    Could it be a network issue resolving the DNS name? I've stuck the DNS into my hosts file and tried again, same result. 

    Is there any way i can check if IIS is slow responding to requests? 

    minimal data is sent in the URL e.g.  http://linkName/index.aspx?rowID=123456 

    Any pointers would be really appreciated.

    Many thanks

    Dave

    Monday, March 18, 2019 12:00 PM

Answers

  • User753101303 posted

    Hi,

    Start with https://developers.google.com/web/tools/chrome-devtools/network/ to check http requests and/or run a full page audit using https://developers.google.com/web/tools/lighthouse/

    A common problem is to return a huge payload (a huge HTML table or image files that are bigger than needed).

    Edit: this is just this particular page. Other pages are fine ?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 18, 2019 4:55 PM
  • User465171450 posted

    Have you used the F12 tools to look at what's occurring network wise? 500 ms is not the load time, that's the execution time. Don't forget about transmission time. Since you're using WebForms, you're sending state data in the form of ViewState back and forth. Depending on the size of your page, the viewstate can take a while to transmit. So that takes time when submitting, then the server assembles everything and starts to execute then you have transmission time coming back. So this could easily take a few seconds when you verify the transmission times included. The networking features of the F12 tools will tell you that. Keep in mind, each and every css file, js file, image, etc.. is a separate resource and requires a connection be opened. The page load is done when all of these load. Browsers only have so many connections available at a time, 4 to 6 depending on the browser so they don't go out and get everything at once. Then there's the rendering portion which may take a few hundred milliseconds as it stitches it all together.

    The F12 tools will give you the absolute best picture of what's going on. The network timing will show you what the length of each operation is, as well as how much data is being transmitted. When looking at this, don't forget the amount of data being sent to the server on postback as that is part of the perceived time to load a page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 19, 2019 5:36 PM
  • User379720387 posted

    Install the Lighthouse extension in Google Chrome. Browse to your site and then click on the Lighthouse icon top right.

    It will generate a report and tell you what is slowing things down.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 19, 2019 6:10 PM

All replies

  • User753101303 posted

    Hi,

    Start with https://developers.google.com/web/tools/chrome-devtools/network/ to check http requests and/or run a full page audit using https://developers.google.com/web/tools/lighthouse/

    A common problem is to return a huge payload (a huge HTML table or image files that are bigger than needed).

    Edit: this is just this particular page. Other pages are fine ?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 18, 2019 4:55 PM
  • User465171450 posted

    Have you used the F12 tools to look at what's occurring network wise? 500 ms is not the load time, that's the execution time. Don't forget about transmission time. Since you're using WebForms, you're sending state data in the form of ViewState back and forth. Depending on the size of your page, the viewstate can take a while to transmit. So that takes time when submitting, then the server assembles everything and starts to execute then you have transmission time coming back. So this could easily take a few seconds when you verify the transmission times included. The networking features of the F12 tools will tell you that. Keep in mind, each and every css file, js file, image, etc.. is a separate resource and requires a connection be opened. The page load is done when all of these load. Browsers only have so many connections available at a time, 4 to 6 depending on the browser so they don't go out and get everything at once. Then there's the rendering portion which may take a few hundred milliseconds as it stitches it all together.

    The F12 tools will give you the absolute best picture of what's going on. The network timing will show you what the length of each operation is, as well as how much data is being transmitted. When looking at this, don't forget the amount of data being sent to the server on postback as that is part of the perceived time to load a page.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 19, 2019 5:36 PM
  • User379720387 posted

    Install the Lighthouse extension in Google Chrome. Browse to your site and then click on the Lighthouse icon top right.

    It will generate a report and tell you what is slowing things down.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 19, 2019 6:10 PM
  • User-1225226813 posted

    Thank you everyone for your responses so far.. I really appreciate all your help!

    test 1:

    I disabled viewstate in IIS>Page Controls> ViewState and performed some tests. The responses was pretty much the same, so I've re-enabled it.

    test 2:

    I've taken out the following page icons, and this seems to have made a small improvement. (now approx 2 seconds to load) which is quicker. 

     <link rel="icon" href="/Favicons/cropped-favicon-32x32.png" sizes="32x32" />
    	<link rel="icon" href="/Favicons/cropped-favicon-192x192.png" sizes="192x192" />
    	<link rel="apple-touch-icon-precomposed" href="/Favicons/cropped-favicon-180x180.png" />
    	<meta name="msapplication-TileImage" content="/Favicons/cropped-favicon-270x270.png" />

    test 3:

    Next I've installed lighthouse which has notified me about a whole raft of improvements.

    i. enable text compression:  ( I assume this is Compression in IIS? that's already enabled? could there be another way to do this?)

    ii. eliminate Render-blocking resources:  (this is all CSS. at top of my site.master page, all JS is already at bottom of site.master. - i moved all css to bottom of the page and the performance was still the same)

    iii. Serve static assets with an efficient cache policy (not sure how to do this in IIS)

    Many thanks for your help!

    Dave

    Wednesday, March 20, 2019 9:29 AM
  • User-1225226813 posted

    Thanks for the response Markfitzme.

    I've hit F12 and started digging.  the waiting (TTFB) (time to first byte)  is the longest with 2.3 seconds, 

    queuing 0.75ms

    stalled 0.55ms

    request sent 50us

    waiting (TTFB) 2.3 s

    content download 3.67ms

    I take it the TTFB time is the duration the between the IIS receiving the request and building the result page?

    Thanks

    Dave

    Wednesday, March 20, 2019 10:07 AM
  • User-1225226813 posted

    Thanks all, using all methods mentioned I've been able to narrow down where the fault was. 

    Through a process of removing sections of code and re-adding it, I've worked out which section was causing the problem and re-wrote it.

    Thanks again

    Dave

    Wednesday, March 20, 2019 11:56 AM