locked
1 Page blocking Web UI thread hangs other pages also RRS feed

  • Question

  • I have a webforms website project deployed to an Azure WebApp.

    I have an admin section hosted in the same web application under '/admin' directory.

    There is a page which does some heavy lifting work synchronously and this hangs the pages for end users also.

    What are different options available to solve this issue?
    Thursday, November 9, 2017 3:48 AM

Answers

All replies

  • I would like to know whether your application works fine locally and are you getting any error or exception?

    Also suggest you check the below links and let us know how it goes.

    https://stackoverflow.com/questions/10436981/winforms-application-hang-due-to-systemevents-onuserpreferencechanged-event/11634388#11634388

    https://stackoverflow.com/questions/1216791/winform-application-ui-hangs-during-long-running-operation

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

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Thursday, November 9, 2017 6:51 AM
  • Hi 

    1. No Exceptions, but yes, that webpage does some heavylifting work, synchronously, which is expected.

    2. It is a web forms project, not a winforms. Does that make any difference to your reply?

    Thanks


    Sangeet Ahuja

    Friday, November 10, 2017 9:09 PM
  • Hi Sangeet,

    I suggest you go async and move that heavy lifting work to a WebJob:

    Run Background tasks with WebJobs in Azure App Service

    Hope this helps!


    Best Regards,
    Carlos Sardo

    Monday, November 13, 2017 2:45 PM
  • Hi, 

    I understand the webjobs would the right solution in this case.

    Is there any interim solution to mitigate this issue in the meanwhile. If its due to UI threads being blocked, is there someway to increase the number of UI threads on my webapp ?


    Sangeet Ahuja

    Thursday, November 16, 2017 6:27 AM
  • As mentioned by Carlos, you should consider moving to Async to allow UI responsiveness while the long-running operation is on-going.

     

    Asp.Net does not have a concept of UI Threads even in a Web Forms application. You may adjust the .Net Threadpool and Asp.Net settings as outlined in the this page: .NET Threadpool and ASP.NET Settings.

    That being said, you should really look at the approach mentioned in the document

    Profile live Azure web apps with Application Insights to ensure if the threads are the bottleneck.

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

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Wednesday, November 22, 2017 4:05 PM
    Owner
  • Hi My initial question was not accurate. I will just update it. When my heavy lifting page is blocking the ui for me, it does cause delays for other concurrent users also. The higher order bit here is wait time for other users. So whats the better approach here 1. Asynchronously use the background worker task on my azure webapp 2. Or Use Azure webjobs Thanks

    Sangeet Ahuja

    Friday, June 8, 2018 10:52 AM
  • If your requirement fits, you may use Webjobs.

    Also, if you haven’t already looked into the document Profile live Azure web apps with Application Insights, checkout the steps for analyzing the performance.

    Saturday, June 9, 2018 8:15 AM
    Owner
  • Hi Ajay, 

    I have got app insights enabled and I can see the perf data. I see BLOCKED_TIME in the samples.

    However, how can I verify, if other concurrent end-users are affected (decreased responsiveness, speed) due to what admin staff is doing on the admin section page (doing some heavy lifting work synchronously) ?

    It is a more of a business decision that depends on the answer of the above question, that we will be going to async (webjobs/webfunctions) ONLY IF, other concurrent end users are effected.

    Thanks


    Sangeet Ahuja


    Wednesday, September 5, 2018 1:46 PM
  • Sangeet, it sounds as if you are hitting a resource contention. If true, it wouldn't matter how many users are logged in. If the web server is running low on resources, everyone connecting to the web server would be impacted. The other concern is, how are you sure the resource issue is occurring on the web app? If the heavy lifting work is calling a SQL DB or other resource, the issue could be with that service or the connection between the services.

    Thursday, September 6, 2018 7:06 AM
    Owner