WCF Service ocassionally hangs and requires restart.

Paul D 1 Reputation point

I have a WCF service hosted in a webapp on Azure that will stop accepting requests approximately once a month. It will not accept any requests until I restart the web app. Then it will work perfectly for a while. I am trying to nail down the issue so I can make the service run without requiring any restart. Here is what I believe. It is not a CPU or memory issue. CPU always runs very low and peeks at 48%. Memory never goes over 70%. When it hangs CPU and memory are low and stay low. When a request comes in the processing time is less than a second. The service processes about 800 requests per day. There is no time consuming code. I am not sure if I have an issue in my code that is leaving connections open and causing grief or it there is something in the web.config that looks incorrect. Any help or suggestions as to what is causing he web app to require the occasional restart would be greatly appreciated. Any suggestions where I should start looking to determine the issue would also be really appreciated. Below is my web.config. Thank you.

Microsoft Entra
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Michael C. McKinnon 81 Reputation points

    Do you have any error logging or event logging implemented on the web app? can you integrate app insights into it? sounds like there is one thing that is borking this and its happening very infrequently. is the web app set to always on? since it seems so rare the first place i'd be looking is at request / activity logs for the times just before it stops working (i am assuming at 800 req/day you could figure out when it stops working within a span of about 30 minutes)?

    0 comments No comments

  2. Marilee Turscak-MSFT 35,616 Reputation points Microsoft Employee

    Please share the error and event logs as eberdev mentioned.

    You can implement a load balancer allowing you to open 10 connections from a single client. You can open new connections requests, or combine requests so that you can send a single request with more data rather than separate requests with less data.

    0 comments No comments

  3. Johan Lindberg 1 Reputation point

    PaulD-6267 Did you get anything on this?
    We're seeing the same thing on some of our selfhosted WCF services.

    Services that has been running all 2019 without problem now sometimes stops responding.
    It started for us in 2020 February, and now we have to restart the service manually when it happens.
    Which is about once every second week.

    Nothing in event-logs, no exception is thrown. We're using Net.TCP on the services that fails.
    The services using soap binding doesn't seem to have the problem.

    0 comments No comments

  4. Jiva Bagale 0 Reputation points

    Paul D,

    Did you ever find the cause for this issue?

    We are experiencing the same issue. The crash happens at random interval sometimes once a month but sometimes once a day for few days too.

    0 comments No comments