Search code examples
azureazure-web-app-serviceazure-webjobsazure-app-service-plans

ThreadCount Metric in AzureAppService


I have an S2 AppService plan that has a webjob with an instance count of 1 (default). The webjob basically reads from a service bus topic using 5 (configurable) concurrent threads.

Recently, we had a huge load coming in and the webjob was unable to quickly read through all the messages in the SB Topic, so we increased the instance count from 1 to 10 and the threads from 5 to 10.

I am trying to understand if the webjob's thread count has any relation with the appservice's threadcount metric? If yes, I still see the max thread count as 35. If no, is there a way to correctly measure the number of active threads of my webjob at any instance of time?


Solution

  • As per the doc Understand metrics: Thread Count --> The number of threads currently active in the app process. It should include the azure webjob's thread count. But as per my testing, the doc seems incorrect.

    You can give it a try by going to the kudu site to check the thread count for each webjobs.

    Steps: Go to azure portal -> your azure web app -> Advanced Tools -> click the go button:

    enter image description here

    Then in the kudu site -> click the Process explorer tab, then check the thread_count column for threads of your webjob:

    enter image description here