Why is the Azure App Service response time pegged at 1.5 minutes

David Thielen 2,506 Reputation points
2024-06-25T18:32:01.48+00:00

Hi all;

I am using the Azure App Service monitor to track the response time under load test. This is what I am getting.

ResponseTimeGraph

I think this is due to a single call to blazor.js that itself is taking 1.5 minutes. Is that correct?

BlazorLoadTime

And if that is the issue, is there a way to get a response time measure that measures the time for a user to view the page as loaded (which is generally 0.3 seconds) instead of waiting for every last bloody item to fully load? (I understand that that is a hard thing to ascertain, but I'm hoping.)

thanks - dave

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,470 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,245 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. brtrach-MSFT 15,701 Reputation points Microsoft Employee
    2024-06-26T06:08:10.88+00:00

    @David Thielen It seems like the request you mentioned is a Blazor server-side prerendering request. This request is used to generate the initial HTML for the page on the server before it is sent to the client. The response time of this request can be affected by various factors, such as the complexity of the page, the amount of data being transferred, and the server load.

    If you are seeing a response time of 1.5 minutes for this request, it is possible that there is an issue with the server-side rendering process. You may want to investigate the server logs and performance metrics to see if there are any errors or bottlenecks that could be causing the slow response time.

    Logs I would suggest reviewing in order of likelihood of showing something (items 1 and 2 are found in the App Service logs blade. Item 4 is set under diagnostic logs):

    1. Application logging: These logs contain information about the requests and responses processed by your application, as well as any errors or exceptions that occur. You can view these logs in the Azure portal.
    2. Web Server logging: These logs contain information about the server environment, such as CPU usage, memory usage, and disk space. You can view these logs in the Azure portal.
    3. Performance counters: These metrics provide real-time information about the performance of your application and the server environment. You can view these metrics in the Azure portal or use a tool like Azure Monitor to create custom dashboards and alerts. (setup your perf counters to log CPU usage, memory usage, network traffic, disk usage, http requests, response time, and error rates)
    4. Diagnostics logs: These logs contain detailed information about the internal workings of your application, such as database queries and HTTP requests. You can enable these logs in the Azure portal and view them in tools like Application Insights or Log Analytics.
    5. Traces: These logs contain detailed information about the execution of your application code, such as method calls and variable values. You can use a tool like Application Insights or Log Analytics to collect and analyze these logs.

    Regarding your second question, it is possible to measure the time for a user to view the page as loaded instead of waiting for every last item to fully load. One way to do this is to use a tool like Google Lighthouse, which measures the time to first meaningful paint (when the primary content of a page is visible) and time to interactive (when the page is fully interactive). Another way is to use a tool like Azure Application Insights, which can track custom metrics and events that are specific to your application.

    Since the item that is taking long to load is the initial HTML rendering, I would assume your users are waiting nearly 1.5 mins to view your page. I would suggest spending time resolving why your rendering is taking so long as this does seem like an unnecessary amount of time.

    Start with this and let me know if you have further questions or concerns.

    0 comments No comments

  2. David Thielen 2,506 Reputation points
    2024-06-26T11:58:12.2533333+00:00

    I found the solution - somehow we did not have web sockets enabled. Once we did that the problem went away.

    thanks - dave