locked
MVC Slow page loads on different layout pages RRS feed

  • Question

  • User-971138563 posted

    Hi,

    We have an MVC application. 

    We wanted to implement react into the project. We are not developing a new product, we will implement react step by step.

    Our project is using a layout for mvc framework. React versioned pages are using another layout for pages.

    React pages and mvc pages are working as expected.

    But the problem is when we click an mvc page while we are on react page. It takes too much time to load page, sometimes 1 minute to load. But once the page is loaded other requests are as expected. 

    so the problem occurs sometimes and when we click a page from a different layout.

    What could be the reason for this?

    Since it is an unkown issue I can't provide sample code..

    Tuesday, July 2, 2019 5:21 AM

All replies

  • User197322208 posted

    the problem is when we click an mvc page while we are on react page

    You do not click a "mvc page". You click an Action that answers with a View

    So you should monitor 2 things:

    1. Time to execute the Action
    2. Time to execute the View

    See https://bradwilson.typepad.com/blog/2010/07/aspnet-mvc-filters-and-statefulness.html 

    Tuesday, July 2, 2019 12:26 PM
  • User-474980206 posted

    a possible cause is that while  on the react page, the mvc app is shutting down due to idle timeout. you might want to install application insights.

       https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net

    Tuesday, July 2, 2019 2:14 PM
  • User-971138563 posted

    Yes, in route config for react pages, we are redirecting to every request to home/index. And react router is handling the url.

    I'll check the durations for executing actions and views.

    Wednesday, July 3, 2019 5:03 AM
  • User-971138563 posted

    a possible cause is that while  on the react page, the mvc app is shutting down due to idle timeout. you might want to install application insights.

       https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net

    Application insight is already installed. Application is hosted on azure and always on feature is on. If this is the case and azure always on feature is not working properly what is the solution for this?

    Wednesday, July 3, 2019 5:05 AM
  • User-971138563 posted

    kkbb

    the problem is when we click an mvc page while we are on react page

    You do not click a "mvc page". You click an Action that answers with a View

    So you should monitor 2 things:

    1. Time to execute the Action
    2. Time to execute the View

    See https://bradwilson.typepad.com/blog/2010/07/aspnet-mvc-filters-and-statefulness.html 

    Here are the durations;

    Home : React page
    Settings : Non React page

    From home to settings
    Action 'Settings :: Index', Execute: 62ms, Render: 2080ms.
    But the Settings page load duration ise 7.42 seconds

    From settings to back home
    Action 'Home :: Index', Execute: 85ms, Render: 7ms.
    Page load duration: 1.32 seconds

    From home to settings
    Action 'Settings :: Index', Execute: 50ms, Render: 5ms.
    Page load duration: 1.23 seconds

    From home to Settings
    'Settings :: Index', Execute: 210ms, Render: 554ms.
    But the settings page load duration is 22 seconds

    From settings to home
    'Home :: Index', Execute: 1025ms, Render: 87ms.
    page load duration: 4.15 seconds

    From home to Settings
    'Settings :: Index', Execute: 67ms, Render: 49ms.
    Page load duration: 2,5 seconds

    From settings to home
    'Home :: Index', Execute: 1246ms, Render: 86ms.
    page load duration: 4.25 seconds

    Wednesday, July 3, 2019 9:03 AM
  • User-474980206 posted
    You should next check the browser performance profile. Do you have long parse times. 22 seconds implies a lot of re-parse, or just maybe too complex markup or too much.

    Wednesday, July 3, 2019 1:19 PM
  • User-971138563 posted

    You should next check the browser performance profile. Do you have long parse times. 22 seconds implies a lot of re-parse, or just maybe too complex markup or too much.

    Here are the browser performance values;

    For Home page;

    • Loading: 0.2 ms
    • Scripting: 1332.6 ms
    • Rendering: 203.7 ms
    • Painting: 73.5 ms
    • System: 132 ms
    • Idle: 1326 ms

    For Settings page;

    • Loading: 67 ms
    • Scripting: 1396 ms
    • Rendering: 329 ms
    • Painting: 32 ms
    • System: 437 ms
    • Idle: 20646 ms

    For the 2nd request for Settings page;

    • Loading: 49 ms
    • Scripting: 1317 ms
    • Rendering: 124 ms
    • Painting: 12 ms
    • System: 167 ms
    • Idle: 1740 ms

    Thursday, July 4, 2019 10:05 AM
  • User-474980206 posted
    What does your browser network trace show. Any blocking requests?
    Thursday, July 4, 2019 4:22 PM