WCF service hosted on Azure App service never seems to complete threads unless restart activity is performed

Ashutosh 96 Reputation points
2020-08-28T14:12:11.04+00:00

I have a WCF service that performs just one task - send a message to the topic.

This is performed in the below sequence.

  1. Accept a request.
  2. initialize a Service bus topic client
  3. Send the requested message to the topic.
  4. Closed the topic client.

While sending a burst of 1000 requests, the app works but the number of threads initiated always stays in waiting state. However, while these threads are waiting CPU stays at 0%. The average response time from this service is also under 100 ms avg.

What could be the potential root cause of this issue?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,401 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,929 questions
{count} votes

Accepted answer
  1. Ashutosh 96 Reputation points
    2020-09-01T13:34:16.483+00:00

    Hi, My issue is resolved. It was due to dependency injection being initialized in the constructor rather in a global.asax file.

    Thank you so much for your help.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ashutosh 96 Reputation points
    2020-08-29T07:19:12.15+00:00

    Thank you for responding. I think the above suggestions are not applicable to my scenario.

    The WCF service (deployed on Azure App services - S1 tier) is set up as a backend app and called by API management frontend as SOAP-Passthrough option.

    I am testing this service via Postman by running tests with 1000 requests with 50 ms interval.

    To simplify things in the actual requirement to send messages to a topic, I implemented an extremely simple Ping method. The function of this service is to echo the request sent. Load testing this service produces the same behavior has before i.e. threads equal to the number of requests sent remain in waiting for state forever (as shown below).

    Please advise what other details I can provide to get the best help.

    I have also tried suggestions in this article without any success. https://learn.microsoft.com/en-au/troubleshoot/dotnet/framework/wcf/service-scale-up-slowly

    21307-image.png

    21308-image.png