1

Service

I have WCF service under high load. Response time is averaging ~60 ms. Service uses mostly default configuration, except of maxConcurrentCalls="5000", endpoint with basicHttpBinding is exposed.

Client

Another service (further "client") is consuming this one. Infrequently (like 0.5%) there are TimeoutExceptions (*). sendTimeout on client is set to "00:00:05".

Load Test

I can reproduce same with VS Load Testing:

[TestMethod] public void Test() { using (var client = new SomeServiceClient()) { // some randomization to make request more realistic var response = client.GetSomething(request); } } 

Timeouts disappear when:

  1. I increase sendTimeout.
  2. I create one channel and reuse it during whole load testing.

Now weird stuff:

Load test (even when there are timeouts) shows test time averaging 0.06, and at maximum taking 0.2 second, which is by far lower than 5 seconds. This also happens in production (logs say so), but no customer impact identified so far.

Question

Does anybody have any idea what could be wrong?

Alternatively: what would you suggest for this scenario in terms on WCF configuration/instancing/etc?

As of scalability all this stuff is already running on many hosts: client on 4 hosts, service as well on 4 hosts. Would increase in number of clients help here?


(*) When I refer to TimeoutExceptions I always mean client side exceptions.

System.TimeoutException: The request channel timed out while waiting for a reply after 00:00:05. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to 'http://someservice.intranet/99.99/someendpoint.svc' has exceeded the allotted timeout of 00:00:05. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out


Any WCF gurus willing to help?

5
  • 2
    1. There are few other timeouts, in most cases you need to modify recieveTimeout Commented Feb 19, 2013 at 18:46
  • 2
    2. You need turn on full tracing. In SvcTraceViewer.exe you will be able to see nice diagram of what is going on and where lag is. Commented Feb 19, 2013 at 18:48
  • @Mike Chaliy, I'm sure it has something to do with sendTimeout, as increasing it helps. Also this says that recieveTimeout is not used on client: stackoverflow.com/questions/5303116/… (don't know if I can believe in this) Commented Feb 19, 2013 at 18:50
  • @MikeChaliy as of tracing. I didn't think about it before. Thanks for the hint. Commented Feb 19, 2013 at 18:52
  • 1
    When you removed this one aspect "one channel and reuse it" you eliminated going to the network stack and creating a new connection for each call. Same logic holds true with pure DB connections, many times the most costly event is establishing the connection. Re-use an established connection wherever possible. Commented Feb 19, 2013 at 20:03

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.