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
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.
{count} votes
Thanks for your response.
Please note here, WCF service is able to service hundreds of connection simultaneously from different WCF client (across different VMs) & we can see that from netstat .
but I will double chk above setting with team (within our org) managing WCF service to be sure about it & add my reply here with existing settings. It might have some delay due to Christmas holiday.
But Issue as we see is particular is with WCF clients (own by our team)- it is only initiating 2 simultaneous http connection with WCF service.
if you still see behavior is associated with setting (mentioned by you above) - please let me know.
RindaniKuldipGEHealthcare-6840 avatar image
0 Votes" 0
RindaniKuldipGEHealthcare-6840 answered · 4 secs ago
I forgot to mention one important thing, connection initiated from WCF client are created as "keep alive".
I found below from proposed RFC 2616 for tcp connection with keep alive - could this be the thing which WCF proxy have default implemented?
https://tools.ietf.org/html/rfc2616#section-8.1.4
Clients that use persistent connections SHOULD limit the number of
simultaneous connections that they maintain to a given server. A
single-user client SHOULD NOT maintain more than 2 connections with
any server or proxy. A proxy SHOULD use up to 2*N connections to
another server or proxy, where N is the number of simultaneously
active users. These guidelines are intended to improve HTTP response
times and avoid congestion.
Hi @Rindani, Kuldip The code I provided is to turn on the concurrency of the wcf service, but judging from some of the information you gave later, it does not seem to be the problem.
hi TheobaldDu,
I got reply from WCF service team and they mention below settings.
Can you please advise here to find out what could be causing this behavior or way to involve WCF tech team at microsoft to help us with this behavior?
Thanks
Hi @Rindani, Kuldip , you can try to set maxconnection attribute in your config file, if it is not work, you can show me your config file.
Sign in to comment
1 answer
Sort by: Most helpful
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
Sign in to comment