WCF Client only creates 2 http connection - due to this Long running calls causes WCF client to block on subsequent request.

Rindani, Kuldip 1 Reputation point
2020-12-20T20:44:46.677+00:00

We have a WCF Client (its a windows service) which connects to WCF server (serving multiples clients) to make a request and some time query can run longer (30-5 minutes) which is causing subsequent request to block.

During investigation (wireshark) - we are seeing WCF client is only creating max 2 http connection which causes all subsequent request to block on this long running queries.

We dont have any connection throttling code to limit http connection.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,648 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Kuldip Rindani 1 Reputation point
    2020-12-29T17:04:49.637+00:00

    Thank TheobaldDu, setting max connection attribute in config file helped and I can see multiple connection going out now.

    <configuration>
    <system.net>
    <connectionManagement>
    <add address = "*" maxconnection = "10" />
    </connectionManagement>
    </system.net>
    </configuration>

    or this could also be achieved by code changes:
    System.Net.ServicePointManager.DefaultConnectionLimit = 10;

    URL for reference:

    https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/connectionmanagement-element-network-settings?redirectedfrom=MSDN

    and
    https://stackoverflow.com/questions/3369970/override-wcf-client-max-connections-prevent-client-side-throttling

    0 comments No comments