WCF Service Throttling
Asked Answered
F

2

17

I have a WCF service deployed in a console app with BasicHTTPBinding and SSL enabled. The following attribute is set as well:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

I have also set the throttling behavior to

<serviceThrottling maxConcurrentCalls="2147483647" maxConcurrentSessions="2147483647"
        maxConcurrentInstances="2147483647" />

On the other hand I have created a test client (for load test) that initiates multiple clients simultaneously (multiple threads) and performs transactions on the server. Everything seems fine but on server the CPU utilization doesn't increase so I added some logging to view the number of concurrent calls to the server and found that it never went over 6.

I have reviewed the performance counter logging code more than twice and it seems fine to me.

So I want to ask where is the problem in this situation? I haven't specified any kind of ContextMode or ConcurrencyMode yet.

After this Post I noticed that whenever i start another Intance of Test Client my concurrent Server Calls counter increase to 2 like if i am running only 1 instance the maximum Concurrent Rcvd Calls will be 2 and if there are two instance the same value goes to 4 and so on. Is there any limit of Number of WCF Calls from once process?

********Added on 17-March********

Today I ran another test with one test client (with 50 concurrent users) on the same machine on which the server is running. This time I am getting the exact result what I wanted it to show (i.e. Maximum concurrent Calls Rcvd by Server = 50).

But I need to do it the same on others machines as well. Can anybody help me on this?

Fridafriday answered 16/3, 2010 at 12:45 Comment(0)
F
19

I found a solution: there is a connection limit on ServicePointManager that was causing this problem. To remove this limit you just need to set

System.Net.ServicePointManager.DefaultConnectionLimit = X;

where the default limit is 2.

Fridafriday answered 19/3, 2010 at 5:31 Comment(2)
From @JuliaS: Where does this line go? Is this a client or WCF service setting?Bleary
sorry for late reply: this goes to any .net application which makes multiple concurrent outbound connection to any server.Fridafriday
H
23

Or use this configuration in the client.

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

Here 200 is the limit from the client

Hitt answered 19/8, 2011 at 7:59 Comment(3)
It is described here codeproject.com/KB/aspnet/10ASPNetPerformance.aspx and perhaps you need to know this support.microsoft.com/kb/969189Rigger
MSDN: <connectionManagement> Element (Network Settings)Buffy
i added maxconnection="100" address = "*" but no luck getting timeout error in WCFHairball
F
19

I found a solution: there is a connection limit on ServicePointManager that was causing this problem. To remove this limit you just need to set

System.Net.ServicePointManager.DefaultConnectionLimit = X;

where the default limit is 2.

Fridafriday answered 19/3, 2010 at 5:31 Comment(2)
From @JuliaS: Where does this line go? Is this a client or WCF service setting?Bleary
sorry for late reply: this goes to any .net application which makes multiple concurrent outbound connection to any server.Fridafriday

© 2022 - 2024 — McMap. All rights reserved.